Open billyb2 opened 3 months ago
An interesting thing I've just discovered while going through the code and considering writing my own implementation is that the problem you'll always get is that the OnExit of the previous state has already been called so you'd have to re-enter it. I also noticed though that returning an error on OnExit will stop the state from transitioning.
In our case, we can put the bootstrap code for the next state in the OnExit of the previous state (very simple enabled / disabled flow)
Hi! While working with this library, I noticed that it isn't really possible to fail a state transition. If a state's OnEntry or OnExit return an error, it looks like the state of the FSM is still updated. Is there a way to automatically set the state back to how it previously was, if the transition fails? I of course could do that by having another trigger, but having that happen automatically could be useful.
Thank you for this amazing library :)