sm icon indicating copy to clipboard operation
sm copied to clipboard

Run closure on transition

Open jamessewell opened this issue 6 years ago • 2 comments

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)
          }

jamessewell avatar Apr 08 '19 06:04 jamessewell

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.

JeanMertz avatar Jun 10 '19 18:06 JeanMertz

+1 this would be a great feature.

0o-de-lally avatar Mar 20 '21 18:03 0o-de-lally