Last active
August 26, 2021 04:50
-
-
Save harsilspatel/e06a1d89290d3da04488c265a1bb9147 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
This file contains hidden or 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 fetchMachine = Machine({ | |
id: 'order-status', | |
initial: 'PENDING', | |
context: { | |
retries: 0, | |
}, | |
states: { | |
PENDING: { | |
on: { | |
x: 'PENDING_PACKED', | |
y: 'PENDING_PICKED', | |
'Ready for Pickup': 'READY', | |
}, | |
}, | |
PENDING_PACKED: { | |
on: { | |
'Ready for Pickup': 'READY', | |
}, | |
}, | |
PENDING_PICKED: { | |
on: { | |
'Ready for Pickup': 'READY', | |
}, | |
}, | |
READY: { | |
on: { | |
'Customer Check-in': 'UNASSIGNED', | |
}, | |
}, | |
UNASSIGNED: { | |
on: { | |
'Attendant Acknowledged': 'ASSIGNED', | |
}, | |
}, | |
ASSIGNED: { | |
on: { | |
Complete: 'COMPLETE', | |
'Failed Complete': 'FAILEDCOMPLETE', | |
}, | |
}, | |
FAILEDCOMPLETE: { | |
on: { | |
Reset: 'PENDING', | |
}, | |
}, | |
HANDOVER: { | |
on: {}, | |
}, | |
COMPLETE: { | |
type: 'final', | |
}, | |
CANCELLED: { | |
on: {}, | |
}, | |
STOCK_IN: { | |
on: {}, | |
}, | |
RETURNED: { | |
on: {}, | |
}, | |
PENDING_ALLOCATED: { | |
on: {}, | |
}, | |
READY_ALLOCATED: { | |
on: {}, | |
}, | |
DISPATCH: { | |
on: {}, | |
}, | |
ARRIVING: { | |
on: {}, | |
}, | |
}, | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment