Skip to content

Instantly share code, notes, and snippets.

@tamebadger
Created May 5, 2021 15:21
Show Gist options
  • Save tamebadger/8dc3c80266ff3fb770ef14692a6864df to your computer and use it in GitHub Desktop.
Save tamebadger/8dc3c80266ff3fb770ef14692a6864df 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: 'onboarding',
initial: 'pristine',
context: {
retries: 0
},
states: {
pristine: {
on: {
SUBMIT_DOCS: 'verification_pending'
}
},
verification_pending: {
on: {
APPROVE: 'success',
REJECT: 'failure',
REJECT_WITH_RETRY: 'retry'
}
},
failure: {
type: 'final'
},
retry: {
on: {
APPROVE: 'success',
REJECT: 'failure',
REJECT_WITH_RETRY: 'retry'
}
},
success: {
type: 'final'
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment