KStateMachine is a powerful Kotlin Multiplatform library with clean DSL syntax for creating complex state machines and statecharts driven by Kotlin Coroutines.
Sometimes it might be useful to listen to group of states. For example you have 3 states. When your are in 1 you set some flag. Then you go to 2 and then to 3. In 3 flag is dismissed (successful result). But what if state 2 have transitions to another states. We might want to dismiss flag if state machine goes in wrong direction. To solve this problem group of states, nested states or transition path might be useful.
Sometimes it might be useful to listen to group of states. For example you have 3 states. When your are in 1 you set some flag. Then you go to 2 and then to 3. In 3 flag is dismissed (successful result). But what if state 2 have transitions to another states. We might want to dismiss flag if state machine goes in wrong direction. To solve this problem group of states, nested states or transition path might be useful.