Skip to content

Instantly share code, notes, and snippets.

@christoshrousis
Last active November 6, 2020 06:36
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 christoshrousis/53e461a7a2c08dd2974c339bede11137 to your computer and use it in GitHub Desktop.
Save christoshrousis/53e461a7a2c08dd2974c339bede11137 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 parcelOnlyPickup = Machine({
id: 'Parcel Valet Workflow',
initial: 'arrived',
states: {
arrived: {
on: {
REQUEST_PICKUP: 'pickup',
PROCESS_PAYMENT: 'processing_payment'
}
},
pickup: {
on: {
PROCESS_PAYMENT: 'processing_payment',
REQUEST_PICKUP: 'pickup',
}
},
processing_payment: {
on: {
SUCCESS: 'ready',
}
},
ready: {
on: {
ARRIVED: 'arrived',
REQUEST_PICKUP: 'pickup',
DEPART: 'depart'
}
},
depart: {
type: 'final'
},
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment