Closed alex-knyazev closed 5 years ago
So, in the case of an async transition, it shouldn't enter/exit the state until the promise finishes?
Would async functions also make sense here and what should their behaviour be?
on(state: T, callback: (from?: T, event?: any) => any): FiniteStateMachine<T>
I would be willing to implement it and create a PR.
@stefnotch
I think in case of onEnter promise must be resolved to go to new state.
But in case of 'on' it isn;t required
@stefnotch Async transitions would be an excellent addition! I would gladly accept such a PR!
@alex-knyazev Agreed, I would expect onEnter
to require the promise to resolve before entering the new state. on()
does not limit state transition so fire and forget is okay there.
It is very good library, but i need to have more powrful control on function:
It is very good to be: