-
Notifications
You must be signed in to change notification settings - Fork 88
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
immediate
with no transition?
#210
Comments
I'd be open to it given that it doesn't add a bunch of complexity to the code. If you're reusing existing functionality but just wrapping it in a cleaner API, that could work. Let me know what you think. |
Ah, it has been a while since I've looked into this, so my memory has faded a little. My original idea would require a few more changes, if I am not mistaken; I remember looking into robot's code and finding out we would most likely need a new kind of transition, but that wouldn't transition; so the handling would have to be slightly different. Currently, I have worked around it by basically having extra steps that set up data for me, then immediately transition. |
I solve this type of problem with an additional state and an |
My goal was more to set up context data when arriving at a particular state. Think of a wizard of some sort, that is controlled by the state machine; I would like to update my current progress when entering the states, as opposed to when I leave them. It makes it easier to control that kind of situation. As you've mentioned, it can be worked around, but the ability to update context without a transition does not seem harmful to me. |
@matthewp please review this:
Is this harmful in the sense that it's non-functional and therefor in conflict with the design of the library? If not, then I don't see any harm in it either. |
I think an API for this would still be functional. |
XState has
entry
actions, that are executed as soon as you enter a state.Would it be possible to add that to robot? Maybe with an
immediate
that has no transition, just reducers?I've found that this has been asked before, but it has been closed:
#93
Would you accept PR's to add that?
The text was updated successfully, but these errors were encountered: