Skip to content

Instantly share code, notes, and snippets.

@NewAlexandria
Forked from wildersachin/machine.js
Last active March 16, 2021 18:11
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 NewAlexandria/6986bfb76e95fda5057eb78df1acf0e4 to your computer and use it in GitHub Desktop.
Save NewAlexandria/6986bfb76e95fda5057eb78df1acf0e4 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({
initial: 'SUBSCRIPTION_AGR_REQUEST',
states: {
['SUBSCRIPTION_AGR_REQUEST']: {
id: 'SUBSCRIPTION_AGR_REQUEST',
initial: 'READY',
states: {
['READY']: {
on: {
['DONE']: {
target:
'#SUBSCRIPTION_AGR_SUBMIT',
},
},
},
},
},
['SUBSCRIPTION_AGR_SUBMIT']: {
id: 'SUBSCRIPTION_AGR_SUBMIT',
initial: 'READY',
states: {
['READY']: {
on: {
['DONE']: {
target:
'#VALIDATE_AUTH_SIG_LIST',
},
['CANCEL']: {
target: '#CANCELLED',
},
['HELLOWORKS_DONE']: {
target:
'READY',
},
},
},
},
},
['VALIDATE_AUTH_SIG_LIST']: {
id: 'VALIDATE_AUTH_SIG_LIST',
initial: 'READY',
states: {
['READY']: {
on: {
['DONE']: {
target:
'#SUBSCRIPTION_AGR_SIGN',
},
},
},
},
},
['SUBSCRIPTION_AGR_SIGN']: {
id: 'SUBSCRIPTION_AGR_SIGN',
initial: 'READY',
states: {
['READY']: {
on: {
['HELLOSIGN_DONE']: {
target:
'READY',
},
['DONE']: {
target:
'#SUBSCRIPTION_AGR_REVIEW',
},
},
},
},
},
['SUBSCRIPTION_AGR_REVIEW']: {
id: 'SUBSCRIPTION_AGR_REVIEW',
initial: 'READY',
states: {
['READY']: {
on: {
['SAVE_DOC_DECISIONS']: { target: 'READY', },
['SAVE_KYC']: { target: `READY`, },
['DONE']: { target: '#GP_COUNTERSIGN', },
['REJECTED']: { target: '#REJECTED', },
['RETURN_TO_INVESTOR']: { target: '#SUBSCRIPTION_AGR_SUBMIT', },
},
},
},
},
['GP_COUNTERSIGN']: {
id: 'GP_COUNTERSIGN',
initial: 'READY',
states: {
['READY']: {
on: {
['HELLOSIGN_DONE']: {
target:
'READY',
},
['DONE']: {
target:
'#FINALIZE_SUBSCRIPTION',
},
},
},
},
},
['FINALIZE_SUBSCRIPTION']: {
id: 'FINALIZE_SUBSCRIPTION',
initial: 'READY',
states: {
['READY']: {
type: 'final',
},
},
},
['CANCELLED']: {
id: 'CANCELLED',
initial: 'READY',
states: {
['READY']: {
type: 'final',
},
},
},
['REJECTED']: {
id: 'REJECTED',
initial: 'READY',
states: {
['READY']: {
type: 'final',
},
},
},
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment