-
Notifications
You must be signed in to change notification settings - Fork 132
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
Event destination state should be state dependent #25
Comments
+1 too. I'm modelling device registration and unregistration, and i'd like to be able to send a single @kurige, I too would be interested if you currently have a fork with implementation. |
+1 I found such functionality in https://github.com/luisobo/StateMachine |
PR is worth a thousand +1’s |
@blakewatters: I agree with "PR is worth a thousand +1s" :) We have been able to navigate around any need for this feature, for now. But I suspect we will need this for a cleaner implementation. I'm willing to implement a solution when that time comes. |
+1 |
As I understand it, events in TransitionKit can only have a single destination state. This is a result of the set of valid event transitions being state-independent, rather than a function of the current state.
As an example, here's the state machine from the README:
All of the events have a single destination state, regardless of the current state. So, the following state machine is currently impossible to model:
Well, not impossible. You can create two "View Message" events, two "Mark as Unread" events, and two "Delete Message" events... And then fire the correct one in a
if/else if
block by checking the current state. But that quickly becomes unwieldy in a larger state machine.The text was updated successfully, but these errors were encountered: