sm
sm copied to clipboard
Run closure on transition
It would be great if I could pass a closure which is always called when a transition happens:
For example:
sm! {
This {
InitialStates { Stale }
Startup {
Stale => Starting (&application.stop)
}
Shutdown {
Stale => Stopping (&application.stop)
}
Oef, I somehow wasn't "watching" my own repository, so I missed this.
Thanks for the input @jamessewell. I agree that this would be nice to support. I'm not yet sure how to do it as efficient as possible (since currently the crate is mostly type-based and no code (should) remain after compilation).
I've been working a bit more on this crate in the background, so I'll take this into consideration when I continue working on it sometime in the next couple of months.
+1 this would be a great feature.