Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a new way to set from transitions #5

Merged
merged 1 commit into from
Apr 18, 2021

Conversation

norbajunior
Copy link
Owner

@norbajunior norbajunior commented Apr 18, 2021

With this new feature we can group many from definitions with a same state.

  • Add macro Machinist.from/2 that expects a state and a block of to statements
 # ...
 transitions do
   from :locked, to: :unlocked, event: "unlock"
   from :unlocked do
     to :locked, event: "lock"
     to :opened, event: "open"
   end
   from :opened, to: :closed,   event: "close"
   from :closed, to: :opened,   event: "open"
   from :closed, to: :locked,   event: "lock"
 end
 # ...

@norbajunior norbajunior self-assigned this Apr 18, 2021
@norbajunior norbajunior changed the title Add new way to set from transitions Add a new way to set from transitions Apr 18, 2021
@norbajunior norbajunior force-pushed the group-transition-definitions branch 6 times, most recently from 8a31afd to 4e389ea Compare April 18, 2021 15:51
* Add macro `Machinist.from/2` that expects a state
  and a block of `to` statements
@norbajunior norbajunior merged commit 6a3bd73 into main Apr 18, 2021
@norbajunior norbajunior deleted the group-transition-definitions branch April 18, 2021 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant