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
Show previous messages

November 30, 2019 at 2:44am
David did you ever publish the "request" statechart from your talk?
  • reply
  • like

December 20, 2019 at 5:11pm
Hi all, I'm newbie and apologies for my english. I have a problem with cond/guards in xstate.js.org/viz, if I put the condition as recommended in the documentation I have this error:
  • reply
  • like
Uncaught Error: Unable to evaluate guard 'isIdleOnLogin' in transition for event '' in state node 'toolbar.login': e.predicate is not a function at e.next (2.06c6d969.chunk.js:1) at e.transitionLeafNode (2.06c6d969.chunk.js:1) at e._transition (2.06c6d969.chunk.js:1) at e.transition (2.06c6d969.chunk.js:1) at e.resolveTransition (2.06c6d969.chunk.js:1) at e.transition (2.06c6d969.chunk.js:1) at 2.06c6d969.chunk.js:1 at 2.06c6d969.chunk.js:1 at t.nextState (2.06c6d969.chunk.js:1) at onPreEvent (main.2b5d9a5b.chunk.js:1)
  • reply
  • like
and my state machine is:
  • reply
  • like
whats is the problem ? Sorry for the long message. Thanks in advance.
  • reply
  • like
with inline function works ok
  • reply
  • like

December 21, 2019 at 3:37pm
Please post a link to your state machine definition. It is unreadable.
  • reply
  • like

December 23, 2019 at 1:09pm
Sorry, I forgot that possibility. I put only one named condition: "isIdleOnLogin", the rest are inline conditions. The link is https://xstate.js.org/viz/?gist=ce1e1b8228dc9738a6c766eb59a2515b. Thanks.
  • reply
  • like

December 23, 2019 at 7:58pm
The problem is not only in "viz" page, in an application too persist.
  • reply
  • like
Please post a link to your state machine definition. It is unreadable.
Sorry, I forgot that possibility. I put only one named condition: "isIdleOnLogin", the rest are inline conditions. The link is https://xstate.js.org/viz/?gist=ce1e1b8228dc9738a6c766eb59a2515b. Thanks.
  • reply
  • like
Please post a link to your state machine definition. It is unreadable.
and the problem is not only in "viz" page, in an application too persist.
  • reply
  • like
and the problem is not only in "viz" page, in an application too persist.
Sorry, the last post was a my mistake, no problem in application, only with "viz" page.
  • reply
  • like

December 25, 2019 at 1:45pm
Help with a state chart--The visualizer is not showing the transitions from some states. I am not sure why it's not showing the transition arrows from epsEmergencyState to epsExtremeState; epsExtremeState to epsRestorativeState, and so on. Any suggestion will be appreciated.
  • reply
  • like
Sorry, I forgot the url link in my earlier message. Here is the URL link: https://xstate.js.org/viz/?gist=87934eed4eb276962a419155d259be01
  • reply
  • like
You used "ON" instead of "on". Property names are case-sensitive, always.
  • reply
  • like
Thank you so much! I really appreciate it.
  • reply
  • like
do statechart enthusiasts have rules of thumb about what level of complexity warrants organizing code with statecharts
  • reply
  • like
I recently thought about that too when I wanted to implement WebAuthn workflow for my users. I think a statechart is warranted in that case already.
  • reply
  • like

December 26, 2019 at 10:07am
Hi, does anyone know how i would go about running a local/development version of the visualizer? Do i clone the xstate repo, or is it something else?
  • reply
  • like

December 27, 2019 at 11:40pm
anyone know of a video series of someone building a non-trivial app using xstate? I saw the feedback form one, but I'd like more of the advanced stuff
  • reply
  • like

January 14, 2020 at 7:52pm
You can use a transient state to decide where something should go after something has been done
I know this post is old, but couldn't you just decide based on the event when the promise resolves, like so?
  • reply
  • like
Wow, this community has grown. I need to get back into it!!!!
like-fill
1
  • reply
  • like
do statechart enthusiasts have rules of thumb about what level of complexity warrants organizing code with statecharts
The earlier the better. Often the complexity comes creeping in, and you don't realize you need a statechart until after it's become complex. I haven't thought much about rules of thumb for deciding when to do it, but I guess when you start nesting if-tests, or when you are refactoring out the if-tests to keep the code understandable or "clean", you might consider ripping out the behaviour and putting it into a statechart.
like-fill
1
  • reply
  • like
I know this post is old, but couldn't you just decide based on the event when the promise resolves, like so?
Yes, you can do that as well.
  • reply
  • like

January 19, 2020 at 9:49pm
I'm late to the party, this blew my mind 🤯, Model-Driven Code. This talk in React Rally 2019 was 🔥 ht
I knew xstate would be more mainstream, but this is taking it to the next level. Well done, 👏🏻 I wish I were there.
like-fill
4
  • reply
  • like