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
Members
Info

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

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

Component Based Architecture

I am really struggling on understanding how to architect a component based application (Vue) that is being driven by statecharts (xstate). The simple examples I am finding have a lot of code embedded within one or two source files. One of the great things about Vue (and I assume…

thumbsup
4
message-simple
54

[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

Question about onError in parallel states

I know how to "work around" the following issue in a better way using guards, but it concerns me that there might be a bug. I have a parallel state machine that has two states (Q1 and Q2). Each state tries to pop() an element off of an array. The idea is that if the pop() was…

thumbsup
0
message-simple
8

[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

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

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