Replies: 3 comments
-
Is it relevant? |
Beta Was this translation helpful? Give feedback.
-
Sorry about that; in the future, don't hesitate to go in the chat https://gitter.im/statecharts/statecharts and ask for help. Yes, this currently only works for machines, but we can make an enhancement to make it work for callbacks too. |
Beta Was this translation helpful? Give feedback.
-
Yeah... sorry for my tone. I was quite frustrated at that point. Personally, I'm not using this at the moment, but it would still very cool if you could add it :) |
Beta Was this translation helpful? Give feedback.
-
Description
The documentation states:
This wording implies that all children, also callbacks, should get those forwarded events. In reality, those are only forwarded to machines as the actor is only added to
forwardTo
inspawnMachine
:https://github.com/davidkpiano/xstate/blob/master/packages/core/src/interpreter.ts#L986-L988
This has cost me about 6 hours of wondering why my code doesn't work, pulling my hair and finally stepping through the code & reading the xstate source.
I'm not sure what the right behaviour would be, so this is either a bug report against the code or the documentation.
Personally, I'd love this to be possible.
Beta Was this translation helpful? Give feedback.
All reactions