Skip to content

Instantly share code, notes, and snippets.

@Landerson352
Last active March 18, 2021 14:30
Show Gist options
  • Save Landerson352/b2b22737fa571e6bc506054440846699 to your computer and use it in GitHub Desktop.
Save Landerson352/b2b22737fa571e6bc506054440846699 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 issueMachine = Machine({
id: 'issue',
initial: 'none',
states: {
none: {
on: {
USER_PAY: 'diagnosis open'
}
},
'diagnosis open': {
on: {
USER_START_DIAGNOSIS: 'diagnosis in_queue',
}
},
'diagnosis in_queue': {
on: {
VE_ACCEPT_CALL: 'diagnosis call_in_progress',
},
},
'diagnosis call_in_progress': {
on: {
VE_TRANSFER_CALL: 'diagnosis in_queue',
VE_COMPLETE_CALL_WITH_RESOLUTION: 'diagnosis complete / resolved_on_call',
VE_COMPLETE_CALL_DEFINITIVE: 'diagnosis complete / definitive',
VE_COMPLETE_CALL_INCONCLUSIVE: 'diagnosis complete / inconclusive',
},
},
'diagnosis complete / resolved_on_call': {
type: 'final',
},
'diagnosis complete / definitive': {
on: {
USER_SCHEDULE_IN_HOME_REPAIR: 'in-home consumer_scheduled',
},
},
'diagnosis complete / inconclusive': {
on: {
USER_SCHEDULE_IN_HOME_DIAGNOSIS: 'in-home consumer_scheduled',
},
},
'diagnosis closed': {
type: 'final',
},
'in-home consumer_scheduled': {
type: 'final',
},
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment