-
-
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
onDone not triggered for parallel states #1111
Comments
Try doing it in a child |
It works only for the first parallel child moving to a final state. https://codesandbox.io/s/infallible-haze-h73e2 You can change the order of events sent to see it. In any case, if that |
what would be the direction here? |
I have the same problem. |
Wrapping the whole thing in as a child state worked. But it's a bug anyway. |
Looking into this now. EDIT: This might be a trickier issue than thought. Can you please tell me your use-cases @knobo @renerbaffa ? You can just use |
My use-case was fetching all resources needed by a webpage before displaying it. |
@davidkpiano maybe we could also add a dev-only working when we find |
My use-case is similar to @knobo. Fetching from different sources and moving on with the parent state afterwards. |
Description
I was studying parallel states and more specifically trying out the example in the documentation (https://xstate.js.org/docs/guides/final.html#parallel-states). The
onDone
function does not get fired when children states get into the final state.This issue might be related to #335?
Expected Result
As the example in the documentation,
onDone
should be fired when the children get into the final state.Actual Result
onDone
is not fired when the children get into the final state.Reproduction
https://codesandbox.io/s/nifty-ganguly-8bnei
Additional context
Latest version of xstate (4.8.0)
The text was updated successfully, but these errors were encountered: