Skip to content

Instantly share code, notes, and snippets.

@nerfpops
Created Jul 26, 2020
Embed
What would you like to do?
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