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

🚀 XState Wish List

As we're working on releasing 4.7 and moving towards 5.0 this holiday season, I wanted to ask all of you: What is on your XState wish list? Do you wish there was a different syntax for defining machines? Do you wish there were built-in patterns? …

thumbsup
27
message-simple
103

Using a state chart to manage a parallel API endpoint loader

hi there. I'm trying out using a state chart to manage an API client that can automatically refresh an auth token. As part of this, I'd like to also implement a parent machine that can do loading multiple endpoints in parallel. To do this, I'm thinking I can just spawn API…

thumbsup
0
message-simple
0

Serializing and rehydrating nested state machines with xstate

Hi everyone, I have a state machines with a spawned child machine. Serializing it will only render the id the of the service. Thus rehydrating the state machine will render an error once I try to access the service. What is the proper way to serialize the child machine and…

thumbsup
0
message-simple
0

Rendering views with state machines

The way I usually see state machines implemented in frameworks like Vue, React or Svelte is by using conditional rendering (like v-if in Vue, or {#if}...{/if} in Svelte). The machine's current state is used as the condition and the framework renders the view or component…

thumbsup
1
message-simple
3

First time using x-state (quick chart review?)

Hi, getting my head in to start charts and x-state during these many indoor hours! I thought I would try to model my garage door, https://xstate.js.org/viz/?gist=37a6d2c4e4d160b4b859514407b528ba …

thumbsup
0
message-simple
2

How do you force an observable to complete? (invoke not transitioning to onDone)

Follow up from here: https://spectrum.chat/statecharts/general/ondone-not-working-after-invoked-observable~452bafec-4ed2-46df-9b25-dafb1d3f04e9 My obs isn't transitioning to onDone =(. When I use a normal observable that i created with a complete() call, or when i add take(#) to…

thumbsup
0
message-simple
2

Create dynamic state machine

Hi, Can I create a dynamic machine that the path I can take is chang according to history. for example, I have 3 states "eat", "sleep", "walk" I can start with each of the state. …

thumbsup
0
message-simple
4

@xstate/test with useMachine hook

I am creating a model based test using the @xstate/test in an app using React with the useMachine hooks for xstate. Have defined a few tests on the state's meta object (to check if the correct content is displayed in the react component based on the state transitions). This…

thumbsup
2
message-simple
8

FAQ for Managing Hierarchy of XState Actors in React

Reminder: Actors have completely private state and only communicate with messages. How does this model fit into React and XState. Here are my recommendations right now from experimenting, as of xstate 4.7.6 and xstate-react 0.8.0. Please respond if you have found better…

thumbsup
3
message-simple
15

onDone not working after invoked observable?

Stuck. Nut sure if this is a bug or not. Invoked an observable. Doesn't transition to called state in the invoked.onDone parameter. I can get a simple invoked promise to resolve and transition, but the observable doesn't =( …

thumbsup
0
message-simple
2