Skip to content

Instantly share code, notes, and snippets.

@jsommr
Created July 26, 2020 16:35
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 jsommr/9ec423339f8fc2bd48668ebae9493483 to your computer and use it in GitHub Desktop.
Save jsommr/9ec423339f8fc2bd48668ebae9493483 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
const invoicePaymentStatusMachine = Machine({
id: 'invoice_payment_status',
initial: 'open',
states: {
open: {
on: {
PAY: 'paid',
CANCEL: 'cancelled',
UNCOLLECTIBLE: 'uncollectible'
}
},
paid: {
type: 'final'
},
cancelled: {
type: 'final'
},
uncollectible: {
type: 'final',
on: {
CANCEL: 'cancelled',
PAY: 'paid'
}
}
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment