Skip to content

Instantly share code, notes, and snippets.

@allencoded
Created October 27, 2020 02:32
Show Gist options
  • Save allencoded/a0ec2dc8d4385a7c6e5a52675b265d32 to your computer and use it in GitHub Desktop.
Save allencoded/a0ec2dc8d4385a7c6e5a52675b265d32 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({
"id":"pathway_covid_discharge",
"initial":"screen_severity",
"states":{
"screen_severity":{
"on":{
"NEXT":[
{
"target":"outpatient",
"cond":{
"type":"transition",
"rule":{
"all":[
"question_one_option_A",
"question_one_option_B",
"question_one_option_C",
"question_one_option_D"
],
"transitionTo":"outpatient"
}
}
},
{
"target":"severe",
"cond":{
"type":"transition",
"rule":{
"any":[
"question_three_option_A",
"question_three_option_B"
],
"transitionTo":"severe"
}
}
},
{
"target":"moderate",
"cond":{
"type":"transition",
"rule":{
"any":[
"question_two_option_A",
"question_two_option_B"
],
"transitionTo":"moderate"
}
}
}
]
}
},
"outpatient":{
"type":"final"
},
"moderate":{
"type":"final"
},
"severe":{
"type":"final"
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment