Skip to content

Instantly share code, notes, and snippets.

@traverse
Created February 25, 2021 10:31
Show Gist options
  • Save traverse/28f15bc2fd9be3e7557034d7990787fa to your computer and use it in GitHub Desktop.
Save traverse/28f15bc2fd9be3e7557034d7990787fa 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: 'confirm',
initial: 'start',
context: {
confirmed: false
},
states: {
start: {
on: {
START: 'check'
}
},
check: {
on: {
CONFIRM: 'success',
CANCEL: 'start'
}
},
success: {
type: 'final'
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment