Skip to content

Instantly share code, notes, and snippets.

@pixelart7
Last active August 31, 2020 03:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pixelart7/bc1ccf004e1cc09e086bf447b7e18d27 to your computer and use it in GitHub Desktop.
Save pixelart7/bc1ccf004e1cc09e086bf447b7e18d27 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 incomeMachine = Machine({
id: 'income',
initial: 'pending_approve',
context: {
retries: 0
},
states: {
pending_approve: {
on: {
APPROVE: 'awaiting_income',
REJECT: 'cancelled',
}
},
awaiting_income: {
on: {
RECEIVE: 'completed',
CANCEL: 'cancelled',
}
},
completed: {
type: 'final'
},
cancelled: {
type: 'final'
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment