Skip to content

Instantly share code, notes, and snippets.

@alavkx
Created October 19, 2020 19:56
Show Gist options
  • Save alavkx/06bbb544d5e13e2fc3810d02981555e2 to your computer and use it in GitHub Desktop.
Save alavkx/06bbb544d5e13e2fc3810d02981555e2 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 newFOSOnboardingMachine = Machine({
id: 'newFOSOnboarding',
initial: 'idle',
context: {
info: undefined,
account: undefined,
},
states: {
idle: {
on: {
EXPRESS_FOS_INTEREST: 'interested',
},
meta: {
description: 'Interest can come from maybe an email?',
},
},
interested: {
on: {
COLLECT_INFO: 'pendingInformation',
},
meta: {
description: 'Employee process information and plugs that into Salesforce?',
},
},
pendingInformation: {
invoke: {
src: 'gatherBusinessInfo',
onDone: 'infoGathered',
onError: 'failed',
},
meta: {
description: 'Some service that runs all of these details',
},
},
infoGathered: {
invoke: {
src: 'requestCUPACreditCheck',
onDone: 'creditAccepted',
onError: 'failed',
},
meta: {
description: 'Call CUPA that checks credit',
},
},
creditAccepted: {
on: {
SIGN_CONTRACT: 'complete',
},
meta: {
description: 'Some bit of UI somewhere, Docusign?',
},
},
complete: {
entry: 'sendCertificateOfInsurance',
type: 'final',
},
failed: {
type: 'final',
},
},
meta: {
description: 'This describes the steps leading up to getting the user in to a software system.',
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment