Skip to content
This repository has been archived by the owner on Aug 5, 2022. It is now read-only.

Run closure on transition #2

Open
jamessewell opened this issue Apr 8, 2019 · 2 comments
Open

Run closure on transition #2

jamessewell opened this issue Apr 8, 2019 · 2 comments
Labels
enhancement New feature or request

Comments

@jamessewell
Copy link

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

@JeanMertz JeanMertz added the enhancement New feature or request label Jun 10, 2019
@JeanMertz
Copy link
Member

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.

@0o-de-lally
Copy link

+1 this would be a great feature.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Development

No branches or pull requests

3 participants