Skip to content

Instantly share code, notes, and snippets.

@apnerve
Created December 5, 2019 08:46
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 apnerve/4c72b3befadd27217b8c2bb9899caed1 to your computer and use it in GitHub Desktop.
Save apnerve/4c72b3befadd27217b8c2bb9899caed1 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 applicationMachine = Machine({
id: 'application',
initial: 'COURSE_DETAILS',
context: {
retries: 0
},
states: {
"COURSE_DETAILS": {
on: {
submit: 'PERSONAL_DETAILS'
}
},
"PERSONAL_DETAILS":{
on: {
submit: 'PROFESSIONAL_DETAILS'
}
},
"PROFESSIONAL_DETAILS":{
on: {
SUBMIT_GOOD: "OFFER_DETAILS.ACCEPT",
SUBMIT_BAD:"OFFER_DETAILS.REJECT"
}
},
"OFFER_DETAILS":{
states:{
"ACCEPT":{
on:{
accept:"#address",
"accept with cosigner nudge":"#cosigner"
}
},
"REJECT":{
type:"final"
}
}
},
"COSIGNER_DETAILS":{
id:"cosigner",
on:{
submit:"ADDRESS_DETAILS"
}
},
"ADDRESS_DETAILS":{
id:"address",
on:{
submit:"PAYMENT_DETAILS"
}
},
"PAYMENT_DETAILS":{
on:{
submit:"OFFER_CONFIRMATION"
}
},
"OFFER_CONFIRMATION":{
type:"final"
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment