Skip to content

Instantly share code, notes, and snippets.

@maxcell
Created May 25, 2020 14:20
Show Gist options
  • Save maxcell/45ecd335c6e8d84bd843170a0161b3e2 to your computer and use it in GitHub Desktop.
Save maxcell/45ecd335c6e8d84bd843170a0161b3e2 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: 'dialog',
initial: 'idle',
states: {
idle: {
on: {
DISMISS: 'hide',
SHOW: 'show',
}
},
hide: {
type: 'final'
},
show: {
on: {
'': 'one'
}
},
one: {
on: {
NEXT: 'two',
DISMISS: 'hide'
}
},
two: {
on: {
NEXT: 'three',
DISMISS: 'hide'
}
},
three: {
on: {
DISMISS: 'hide'
}
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment