Sending data from parent machine to child invoked callback
I'm basing my code on this section: https://xstate.js.org/docs/guides/communication.html#listening-to-parent-events However, when sending the events PING and PONG, is there any way I can send some other data along? If not, what's the best way to send data from parent machine to…
Trying to update the context of a parent machine from an actor's context
CODESANDBOX REFERENCE: https://codesandbox.io/s/recipemachine-bikxx Hey everyone, I have two machines - one parent and one child - that I'm trying to get to communicate with one another. Specifically, I'd like for the child machine to periodically send an update/event to it's…
What are some approaches to decouple xstate's state from component state?
I got to thinking about this over the weekend. We're starting to use XState much more heavily at work, and being able to refactor machines aggressively without having to touch components sounds nice. Off the top of my head, the only one I can think of is: • Build the equivalent…
Opening UI Elements from anywhere in the app
https://codesandbox.io/embed/xstate-todomvc-33wr94qv1?from-embed In the TodoMVC Demo Application that uses the Actor Model, todosMachine spawns todoMachine(s). One is the direct parent of the other. Now consider a modal that would ideally be accessible from anywhere in the…
@davidkpiano's article on Redux @ dev.to
@davidkpiano -- Just read your article on dev.to, great article! The following is a great example of realizing you need a state machine, trying to solve it via brute force, and abandoning it for XState. Hopefully, it will give you a chuckle... It hit home for me because I had…
Stored/serialized then reloaded states lose their actions' implementation?
If I save a serialized state and then try to restart a machine with this state - following the documentation, I do a state = State.create(reloadedState); and then resolvedState = myMachine.resolveState(state); and then …
Nested actors with TypeScript
Hey, I'm having trouble adding TypeSript to Machines that are using Actors. I tried to replicate my issue in following CodeSandbox. https://codesandbox.io/embed/statemachine-with-typescript-uvg40 The problem in my code happened in the parentMachine when spawning a new child…