Statecharts watercooler
March 7, 2019 at 5:55amStatecharts watercooler
March 7, 2019 at 5:55amNovember 26, 2020 at 10:56am
November 27, 2020 at 4:15pm
Does anybody know why assign actions are not called on entry on the initial state? I have a simple example here of my problem ->
This bug was recently fixed, please use the latest version of
/fsm
November 27, 2020 at 11:15pm
December 9, 2020 at 7:59pm
I'm trying to get a good design pattern going for hierarchical state machines in Hardware Description Language, but I'm new to Statecharts. Consequently, I'm trying to learn from two directions... How to implement Statechart concepts in HDL, and how to produce Statecharts which represent behavior in my existing HDL.
So a specific question of the second type... how would we use a state chart to represent a conditional action which is independent of a state transition?
At present, my best notion would be to, within a state, say do/ if(condition){value = 0}
Or similarly, on a state transition (changeState == true) / if (condition2 == true) {value = 0}
It just starts to be a lot of pseudocode crammed into an action statement.
Does anyone know how to access machine context from within interpreter.onDone() method?
I'm struggling with it...
December 13, 2020 at 6:10pm
So a specific question of the second type... how would we use a state chart to represent a conditional action which is independent of a state transition?
At present, my best notion would be to, within a state, say do/ if(condition){value = 0}
Or similarly, on a state transition (changeState == true) / if (condition2 == true) {value = 0}
It just starts to be a lot of pseudocode crammed into an action statement.
In SCXML, there is
<if>
for this. In XState, the equivalent is the choose(...)
action creator, to give you ideas.Shouldn't it force the machine to be modelled according to the context interface if you provide one?
December 17, 2020 at 3:10pm
December 21, 2020 at 6:27am
December 21, 2020 at 4:12pm
From my understanding one can describe the behaviour of an actor using a callback, a promise, an observable or a machine. The first docs link you mention simply uses the machine case to describe the general concept.
Hey all !
I recently made my first statechart using xstate, This statechart isn't directly modelled in the UI layer, as it has two distinct UIs to drive simultaneously.
I'm now trying to make it easier to understand in the visualizer by regrouping states that share transitions in compound states (clustering, as this page describes it. While statechard.github.io doesn't make the distinction, xstate lets me choose between creating hierarchical state nodes and invoking other machines/actors. Do you have any guidelines about when to prefer one method over the other ?
My guts tell me it's a modularisation/boundaries problem. Also having separate machines allows isolation of the context data. But feel free to correct me.
In addition to this, when creating compound states, I find myself adding more states that don't have a representation in the UI; like final child state nodes. How does a normal xstate + react app handle those to make no re-render happens ?
December 22, 2020 at 1:23am
January 7, 2021 at 9:04pm
January 19, 2021 at 1:35pm