Skip to content

Instantly share code, notes, and snippets.

@TimPetricola
Created January 14, 2021 10:49
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 TimPetricola/9e1581a7baab9070bc9ead2f3fb40cd6 to your computer and use it in GitHub Desktop.
Save TimPetricola/9e1581a7baab9070bc9ead2f3fb40cd6 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 flowMachine = Machine({
id: 'flow',
initial: 'step1',
states: {
// educational
step1: {
on: { NEXT: 'step2' },
},
// educational
step2: {
on: { NEXT: 'step3', PREV: 'step1' },
},
// question
step3: {
on: { NEXT: 'step4', PREV: 'step2' },
},
// congrats
step4: {
type: 'final',
},
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment