v5 - How can I invoke another machine from one machine? #4886
-
Hi! On ulterior versions, I could invoke another machine from one machine like this:
Can you help me on how I can do something like this? Or, can I use a machine to set the initial context of another machine? Thank you in advance for your help! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @DWboutin!
Here's an example of how to achieve what you're trying to do: https://codesandbox.io/p/devbox/zealous-goldberg-l9rc5c?file=/src/main.ts (make sure to open devtools console to see the output) In place of
Sure can! https://codesandbox.io/p/devbox/async-glitter-dh6npw?file=/src/main.ts We can define the type of |
Beta Was this translation helpful? Give feedback.
Hi @DWboutin!
Here's an example of how to achieve what you're trying to do: https://codesandbox.io/p/devbox/zealous-goldberg-l9rc5c?file=/src/main.ts (make sure to open devtools console to see the output)
In place of
data
on the final state, we can define anoutput
type insetup
and then use the top-leveloutput
property which is then available onevent.output
.Sure can! https://codesandbox.io/p/devbox/async-glitter-dh6npw?file=/src/main.ts
We can define the type of
input
insetup
, use that input to set the initialcontext
, and then define the input ininvoke
.