typescript-fsm icon indicating copy to clipboard operation
typescript-fsm copied to clipboard

Add onEnter and onExit hooks

Open carlos-verdes opened this issue 5 years ago • 0 comments

Sometimes in a FSM is needed to just do something not on the transition but when you enter or exit one state. Would be nice to add this functionality.

Good example is your state "breaking" where you want only to log and you have to define the action for all the states that reach that state (would have more sense to do onEnter).

carlos-verdes avatar Feb 18 '19 16:02 carlos-verdes