How to consume parent machine's actor from child? #4999
Unanswered
alita-moore
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I would like to use the parent of a child machine's actor from the child. See a rough example below:
note that this does not work.
This would be useful because I want to call an actor with some stateful side-effect in react. The alternative is that I pass the "otherMachine" as an actor instance when instantiating the "someMachine" in react. I.e. something along the lines of:
vs. what I want to do which is
Edit:
I'm realizing now that it appears that if you pass in the actor after providing the actor to the machine, it will generate a new actor. i.e.
Generates a new actor instance each time it enters the
SetVolumestate, and that actor has access to the provided actor when providing to thesomeOtherMachinemachine. Therefore, it seems that accessing the parent's actor is not required.Beta Was this translation helpful? Give feedback.
All reactions