Skip to content

Commit

Permalink
try guarding against late action dispatches to sub state machine
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielittner committed Jun 21, 2024
1 parent b99ad87 commit 69692a7
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,10 @@ internal class OnEnterStartStateMachine<SubStateMachineState : Any, SubStateMach

coroutineWaiter.waitUntilResumed()
actions.mapNotNull { actionMapper(it) }
.collect {
subStateMachine.dispatch(it)
.collect { action ->
runOnlyIfInInputState(getState) {
subStateMachine.dispatch(action)
}
}
}
}
Expand Down

0 comments on commit 69692a7

Please sign in to comment.