Skip to content

Instantly share code, notes, and snippets.

@johnsonjo4531
Created June 10, 2020 19:29
Show Gist options
  • Save johnsonjo4531/88316dec282b3873214407dbad2544d3 to your computer and use it in GitHub Desktop.
Save johnsonjo4531/88316dec282b3873214407dbad2544d3 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: 'fetch',
initial: 'lit',
context: {
retries: 0
},
states: {
lit: {
on: {
TOGGLE: 'unlit',
BREAK: 'broken'
}
},
unlit: {
on: {
TOGGLE: 'lit',
BREAK: 'broken'
}
},
broken: {
type: 'final'
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment