You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 :)
The text was updated successfully, but these errors were encountered:
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 :)
The text was updated successfully, but these errors were encountered: