typescript-fsm
typescript-fsm copied to clipboard
Add context to FSM
One of the main reasons to use a FSM is to protect the internal state of the model (the context). Normally the context is defined inside the FSM and is only accessible on transitions and onEnter/onExit executions (so you avoid side effects).
The only way to change the context of a FSM is sending an event to it.