Skip to content

Instantly share code, notes, and snippets.

@a-laughlin
Last active January 13, 2021 19:21
Show Gist options
  • Save a-laughlin/2de02b2d2d1f6462465a6805a67a4fa4 to your computer and use it in GitHub Desktop.
Save a-laughlin/2de02b2d2d1f6462465a6805a67a4fa4 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: 'fetch',
initial: 'idle',
states: {
idle: {
on: {
CLICK_INSURANCE: 'idle',
CLICK_PACKAGE: 'idle'
}
},
// approving: {
// on: {
// APPROVED_INS: 'approved_package_w_insurance',
// APPROVED_PACKAGE_W_INS:'',
// DENIED_INS: 'approving_ins',
// DENIED_PACKAGE_W_INS:'',
// NETWORKERROR_PACKAGE_W_INS:'',
// NETWORKERROR_PACKAGE:'',
// }
// },
// approved_package_w_insurance: {
// on:{
// CLICK_CHECKOUT:'on_checkout'
// },
// },
// approved_package: {
// on:{
// CLICK_CHECKOUT:'on_checkout'
// }
// },
// on_checkout: {
// on:{
// CLICK_CONFIRM:'confirmed'
// },
// },
// confirmed: {
// type: 'final'
// }
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment