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

Defining events with data

Hello! Probably it's a typescript question but I kept fighting with that several hours, I did a search here and didn't find any similar question, but sorry if there is. Here is the thing: I want so send some event with data through a service. This service will be only called by…

thumbsup
0
message-simple
5

Planning to refactor state management for a whole application to xstate.

Any red flags for the current version?

thumbsup
0
message-simple
5

How can I pass params o function?

Hi I got problem with params. I would like to send userID to a functions but in event i have a object. I'm using : send("SUBMIT", "user ID");

thumbsup
0
message-simple
2

Display javascript object with react-table

Hi, I know it is possible to display an array of objects in the react-table? Is it possible for me to display an object as in a react-table? example: const obj = { a: 1, b: 2 }; …

thumbsup
0
message-simple
1

@xstate/test and dynamic input to the SUT

Entry in DB has an enum-based "phase" of 8 different string values. There are rules when can be each of those phases reached. It sounds like an obvious candidate for model-based testing. The SUT here is a serverless function that handles the request and receives the ID of entry…

thumbsup
0
message-simple
6

This XState Visualizer is awesome. Can it do real-time?

Might it be possible to embed it in my code so that, while debugging, I can see my machine shift states in real-time as events flow through it? This would be so good.

thumbsup
1
message-simple
3

Don't do this!

i need to tell my next state the media type, video or photo. when user selects to take photo, i send this, send('SELECT_MEDIA', {type: 'openCamera'}) …

thumbsup
0
message-simple
1

Invoked promise resolves, but the machine does not change state

I have a machine and I'm invokeing a promise. This promise is a Userbase .signIn() event. Console.logging in .then() tells me that this event resolves, but the machine does not move on from its current state. I've confirmed, using a mock promise, that the machine configuration…

thumbsup
0
message-simple
11

@xstate/test - state with only guarded transition

I was trying to create a model for my state machine (of course started with trying to reuse my machine that controls UI, but now I know that's not the way to go 😅). Although I have a problem and I am not sure how to solve it. My machine is gathering answers from users and later…

thumbsup
0
message-simple
8

Heartbeat Service in xstate

Hello everyone, Admittedly new to xstate but I feel like a component within our codebase is a great use case for a state machine. I have setup what I want to happen in the visualiser. There's a particular part I'm stuck on however. We have a live state. This will affect the UI's…

thumbsup
0
message-simple
5