Skip to content

Instantly share code, notes, and snippets.

@amoshydra
Last active May 6, 2021 05:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amoshydra/99dbf32fa9f9677e594438dfba54b840 to your computer and use it in GitHub Desktop.
Save amoshydra/99dbf32fa9f9677e594438dfba54b840 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
// - XState (all XState exports)
const fetchMachine = Machine({
id: 'survey-2',
initial: 'q1',
states: {
q1: { on: { ANSWERED: 'q2' }},
q2: { on: { ANSWERED: 'q3' }},
q3: {
on: {
ANSWERED_VALUE_Q1_GTE_3: 'q4',
ANSWERED_VALUE_Q1_LT_3: 'q5'
}
},
q4: { type: 'final' },
q5: { type: 'final' },
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment