Skip to content

Instantly share code, notes, and snippets.

@export-mike
Last active April 3, 2023 02:19
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 export-mike/1bbfff2cc0e06b78ccd7d72f0e8fb27d to your computer and use it in GitHub Desktop.
Save export-mike/1bbfff2cc0e06b78ccd7d72f0e8fb27d to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
const fetchMachine = Machine({
id: 'onboarding',
initial: 'nilApplication',
context: {
retries: 0
},
states: {
invest: {
},
nilApplication: {
on: {
COMPLETE_FIELDS: 'completeFields',
NOVA_PRODUCT_INSTANCE: 'invest'
}
},
completeFields: {
on: {
BETA: 'kyc',
POST_BETA: 'mfa',
DROP_OUT_OF_FLOW: 'nilApplication',
INELIGLE: 'ineligible'
}
},
mfa: {
on: {
COMPLETE: 'kyc',
DROP_OUT_OF_FLOW: 'mfa'
}
},
kyc: {
on: {
COMPLETE: 'invest',
DROP_OUT_OF_FLOW: 'mfa',
INELIGLE: 'ineligible'
}
},
ineligible: {
on: {
RESTART: 'completeFields',
USA_RESTART: 'doWeBlock'
}
},
doWeBlock: {
on: {
LIMITED_LIVE: 'completeFields',
BETA: 'completeFields',
POST_BETA:'blockApplication'
}
},
blockApplication: {}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment