menu

Statecharts

Statecharts are a precise, visual way of modeling the behaviour of complex reactive systems. They describe how things work, and can help you get your code doing exactly what you want.

Channels
Team
Posts
Chat
Members
Info
down-caret

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…

thumbsup
0
message-simple
2

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…

thumbsup
0
message-simple
2

Difference between `Interpreter.subscribe` and `Interpreter.onTransition`

Dumb question: What’s the difference between the subscribe and onTransition methods on an Interpreter? I’m missing something fundamental.

thumbsup
0
message-simple
0

Drawing statecharts

Do you know of any statechart app I can use to draw statecharts? I'm thinking of something like https://www.draw.io/ but perhaps more specific, as draw.io seems to be a generic solution for flowcharts and UML. Thanks!

thumbsup
0
message-simple
5

How to reset history when machine transition into a specific state?

I have a machine https://xstate.js.org/viz/?gist=3bf02d060f5a5243fa6b11c9b5f382b1 I want to reset state b history when state transition into state a Would it be possible?

thumbsup
0
message-simple
2

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 …

thumbsup
0
message-simple
4

@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…

thumbsup
2
message-simple
1

Handling communication between components

Hey folks! I am super new to state machines and I am investigating using them with React, via XState. One thing I am trying to wrap my head around is having multiple components communicate with a single machine instance, based on what I have read…

thumbsup
2
message-simple
2

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…

thumbsup
6
message-simple
13

Example of two actors interacting

Does anyone have a sample repo to refer to for more complex ui interactions. For example multiple different types of filters trying to filter a table. Filter machine being one actor and table machine being another being spawned by a single parent.

thumbsup
1
message-simple
2