menu

Statecharts

Statecharts are a precise 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

Understanding the Actor Model

I'm not familiar with the actor model, so I Googled. Sorry for the dumb questions below, but I want to get a sense of it ... Will actors in xstate essentially be independent states (that can contain substates), or something else? Does each actor have an independent FIFO queue of…

thumbsup
0
message-simple
6

How should I handle non-serializable references

I've got a scenario where I have a class custom-built to accept and provide flexible access inside arbitrary sets of data (the Hierarchy). While I could serialize it, one of the main advantages is simply letting it maintain the only reference to the often massive amount of data…

thumbsup
0
message-simple
4

Invoking a service more than once

Background: I’m trying to model a machine that has 3 states, “pending,” “success,” and “failure.” We start in the “pending” state and invoke a service, and then transition to the “success” or “failure” state according to the outcome. The Issue: After a failure, I want to delay…

thumbsup
0
message-simple
3

Modeling a wizard so it can improve itself

I saw @davidkpiano say, here, that we can use statechart modeling to drive: • Statistical analysis of paths traversed in real-life use • Predictive analytics (based on above) -> reinforcement learning for adaptive UIs …

thumbsup
1
message-simple
12

[xstate] Problems with Context

I am struggling to understand why setting Context with assign doesn't always work. I have a very simple application that you can find here https://codesandbox.io/embed/y0xk1mo9x9 I have this context: which is updated by these functions: …

thumbsup
0
message-simple
5

[xstate] Send built-in action

I don't understand meaning and usage of "send" built-in action. You can see here https://codesandbox.io/embed/7467qk4rox a very simple example, with a machine with two parallel state nodes; the second one send events using send built-in action, but this action seems not to be…

thumbsup
0
message-simple
1

We're in the endgame, now... (refactoring existing component)

Hello. I've got a component I'd like to refactor to use xstate, because as soon as people in my company saw it they wanted to reuse it everywhere. What I'm going to link to is one specific implementation of the template (the "rules building" page) but fundamentally it's allowing…

thumbsup
0
message-simple
13

Waiting on multiple services (what's the best way to model this?)

Let's say (in a very biologically non-correct example) I have three state machines: Me - idle Brain (sub statemachine of Me) - idle …

thumbsup
2
message-simple
3

Chris Zempel

Hello. Spent many years as a full-stack dev in past lives, and now I've gone full front-end. Currently building an incentives platform on top of an in-migration monolith -> microservice setup. Interested in xstate/statecharts for a bevy of reasons, including: actor-based ui's…

thumbsup
2
message-simple
7

xstate onTransition, nested

I was implementing a three-layer navigation with the state Machine and I thought of nested state machines: const machine2 = Machine( { Id: 'nav2', …

thumbsup
1
message-simple
1