Skip to content

Instantly share code, notes, and snippets.

@nightink
Last active December 19, 2019 09:20
Show Gist options
  • Save nightink/7137a2ee85324c1dfd1cfcf7a5a55dee to your computer and use it in GitHub Desktop.
Save nightink/7137a2ee85324c1dfd1cfcf7a5a55dee 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 paymentMachine = Machine({
id: 'payment',
initial: 'method',
states: {
method: {
initial: 'cash',
states: {
cash: { on: { SWITCH_CHECK: 'check' } },
check: { on: { SWITCH_CASH: 'cash' } },
hist: { type: 'history' }
},
on: { NEXT: 'review' }
},
review: {
on: { PREVIOUS: 'method.hist' }
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment