Skip to content

Instantly share code, notes, and snippets.

@Sydney-o9
Created August 28, 2020 05:58
Show Gist options
  • Save Sydney-o9/1e371597a872fb7205571150ed133367 to your computer and use it in GitHub Desktop.
Save Sydney-o9/1e371597a872fb7205571150ed133367 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: 'task status',
initial: 'NotStarted',
states: {
NotStarted: {
on: {
Start: 'Running'
}
},
Running: {
on: {
Pause: 'Paused',
Finish: 'Done'
}
},
Paused: {
on: {
Resume: 'Running',
Finish: 'Done'
}
},
Done: {
type: 'final'
},
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment