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

machine vs createMachine

what is the difference?

thumbsup
0
message-simple
1

Can't find asEffect action

I can't find the asEffect action in the xstate and react packages.

thumbsup
0
message-simple
3

Best way to access child service (created on later state change) in vue…

Hey So I have a root machine which then invokes a child machine when the state changes. If I have a single component what’s the “right” way to access the child service? Assuming that the component was already created and mounted. The state change which resulted in the child…

thumbsup
0
message-simple
7

Is there a difference between `sendUpdate` and `sendParent`?

... when working with spawned children that are not synchronized with the parent, there are a few ways to send messages from the child to the parent. sendUpdate is new as of v4.7. What is the intended distinction compared to sendParent?

thumbsup
0
message-simple
1

Share: Small piece of code for console.logging transitions

Thought somebody might find this useful - I certainly am :) It can for sure be better but it's doing the job I intended so Im happy. It basically outputs all state transitions to the console, along with the state's current context in a collapsed log group. Also logs when a…

thumbsup
2
message-simple
3

xstate-codegen - gives you 100% type safety in XState

XState is the bomb, but I kept getting scared that I wasn't getting 100% type safety when using it with TS and React. This codegen package gives you full type safety over everything: actions, guards, services etc. https://twitter.com/mpocock1/status/1288782560621928448 Looking…

thumbsup
9
message-simple
16

Is there a way to clear an interval without transitioning to another state?

I realize I basically have a state for the sole purpose of being able to clear an interval. Because the function returned from 'src' will be called only when the state transitions to a new one, I had to create a state which really represents nothing. Is there a better way to…

thumbsup
0
message-simple
2

XState Guide

I started a guide detailing how to make UI components using XState. It might be helpful for anyone using React & TypeScript stack. Let me know if you have any feedback. https://bradwoods.io/xstate-guide

thumbsup
15
message-simple
36

Should states be past-tense? Modelling help....

Hey, I'm going back and forth on modelling this machine and am wondering if perhaps my mental model is incorrect. Best explained with a simple example... …

thumbsup
1
message-simple
7

Eventless vs transient transition are they same ?

according to the examples on the Docs, it seems no different but the definitions are not? can someone remove the confusion?

thumbsup
0
message-simple
2