You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a bit of familiarity with XState, and while coming up to speed on xstate-wizards, I found it helpful to visualize/simulate the resulting XState state machine using stately.ai. Here's the xstate-react demo on stately.ai.
However, to get vanilla XState JSON I could import in stately, I had to hack a log line into packages/spells/src/machines/createSpell.ts (after the state prepper, before the createMachine call).
Can we refactor this (and/or create a utility function) to get the JSON-serializable object back? Would be good to be able to get back the state machine underlying any spell.
The text was updated successfully, but these errors were encountered:
100% love this goal. Maybe the API for createSpell can shift a bit:
createMachineConfig could be a function on there for just getting back JSON. Basically takes all of the logic of the current createMachine method, but just doesn't do the create machine call as you pointed out.
createMachine is refactored to just call that function, ex: return createMachine(this.createMachineConfig())
And then that way createMachine continues to work as is.
I have a bit of familiarity with XState, and while coming up to speed on xstate-wizards, I found it helpful to visualize/simulate the resulting XState state machine using stately.ai. Here's the xstate-react demo on stately.ai.
However, to get vanilla XState JSON I could import in stately, I had to hack a log line into
packages/spells/src/machines/createSpell.ts
(after the state prepper, before thecreateMachine
call).Can we refactor this (and/or create a utility function) to get the JSON-serializable object back? Would be good to be able to get back the state machine underlying any spell.
The text was updated successfully, but these errors were encountered: