Skip to content

Instantly share code, notes, and snippets.

@dfee
Last active August 12, 2021 18:44
Show Gist options
  • Save dfee/5f908c2f421949142f29ad280487b946 to your computer and use it in GitHub Desktop.
Save dfee/5f908c2f421949142f29ad280487b946 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({
initial: 'notStarted',
states: {
notStarted: {
on: {
save: 'inProgress',
done: 'completed'
}
},
inProgress: {
on: {
submit: 'underReview',
done: 'completed'
}
},
underReview: {
on: {
reject: 'inProgress',
done: 'completed',
}
},
completed: {
type: 'final'
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment