Last active
November 6, 2020 06:36
-
-
Save christoshrousis/53e461a7a2c08dd2974c339bede11137 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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