-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Relative paths for In State Guards #349
Comments
Closing this as it doesn't make sense to support it. For this example, you can simply specify the transition on the success: {
on: { TOGGLE: '#visible' } // or whatever the ID is
} Or you can use final states to accomplish a similar thing. The difference is that this says:
Rather than:
The first one is simpler and should be preferred. |
My example was just a simplification of the real world use case. I just wanted to highlight the relative in guards feature request. |
I agree that this should be supported - the handling of relative paths should be consistent, even if |
One more thing I've discovered while looking into this - seems like This makes it unobvious what the What's the reasoning behind this grandparent matching there @davidkpiano ? Either way - I believe we shouldn't touch this in v4 and just clean up both targets and |
Good question. This goes back to the original Statecharts paper: The original purpose for the
Therefore, matching When using |
Is "the same level as a given state node" stated somewhere or is it just an interpretation? Just curious. The use case itself sounds perfectly reasonable - that's also what is stated in SCXML:
In the current implementation it also only checks unconditionally grandparent - without taking into account that it might not be a parallel state. So this can bring even more confusion for people. Just some random thoughts after reading through this 😉 I still believe we should go through all possible use cases, combinations etc and design targets & in |
I'm working on a feature that will only accept
TOGGLE
if the child statesuccess
is active. For that I used an In State Guards and it worked pretty well.I noticed that
in: ".success"
doesn't work, so I had to usein: "hidden.success"
, it's a "semi-absolute" path.It would be great if
in
worked with relative paths, sotarget
and in would be consistent:The text was updated successfully, but these errors were encountered: