Last active
June 2, 2021 19:15
-
-
Save zacharysyoung/4ba39f7ff7f33903e248d45df97ac7e5 to your computer and use it in GitHub Desktop.
Funding/Check states
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: 'Funding - Checks', | |
initial: 'verifying', | |
states: { | |
incomplete: { | |
on: { VERIFY: 'verifying' } | |
}, | |
verifying: { | |
on: { | |
VERIFY_INCOMPLETE: 'incomplete', | |
VERIFY_COMPLETE: 'ready for billDotCom' | |
} | |
}, | |
'ready for billDotCom': { on: { HANDOFF: 'pending' } }, | |
pending: { on: { SCHEDULE: 'scheduled' } }, | |
scheduled: { on: { ISSUE: 'issued' } }, | |
issued: { on: { SEND: 'sent' } }, | |
sent: { | |
on: { | |
CLEAR: 'cleared', | |
RETURN: 'returned', | |
TIMEOUT: 'uncashed', | |
CANCEL: 'cancelled', | |
VOID: 'voided' | |
} | |
}, | |
cleared: { type: 'final' }, | |
returned: { on: { RESEND: 'sent' } }, | |
uncashed: { on: { CANCEL: 'cancelled' } }, | |
cancelled: { on: { VOID: 'voided' } }, | |
voided: { type: 'final' }, | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment