Skip to content

Instantly share code, notes, and snippets.

@olexpono
Created January 11, 2021 17:19
Show Gist options
  • Save olexpono/ccdf9503e1ea91ed8ba6d9e15ea71c8c to your computer and use it in GitHub Desktop.
Save olexpono/ccdf9503e1ea91ed8ba6d9e15ea71c8c 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: 'quoteStatus',
initial: 'draft',
states: {
draft: {
on: {
'quote': 'quoted',
'flag_for_referral': 'pending_referral',
'decline': 'declined'
}
},
pending_referral: {
on: {
'refer': 'referred',
'withdraw': 'not_taken'
}
},
not_taken: {},
referred: {
on: {
'clear_referral': 'quoted',
'decline': 'declined'
}
},
quoted: {
on: {
'edit': 'draft',
'bind': 'bound',
'withdraw': 'not_taken',
'expire': 'expired'
}
},
expired: {
'requote': 'quoted'
},
declined: {},
bound: {},
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment