Skip to content

Instantly share code, notes, and snippets.

@LeonLiuY
Last active May 11, 2020 07:40
Show Gist options
  • Save LeonLiuY/50942b81c8f43576d310b807c7fd7c5b to your computer and use it in GitHub Desktop.
Save LeonLiuY/50942b81c8f43576d310b807c7fd7c5b 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({
"states": {
"init": {
"on": {
"": [
{
"target": "screenerQuestionFirst",
"cond": "screenerQuestionFirst"
},
{
"target": "resumeFirst",
"cond": "resumeFirst"
}
]
}
},
"screenerQuestionFirst": {
"states": {
"sq": {
"on": {
"NEXT": "resume"
}
},
"resume": {
"on": {
"PREV": "sq",
"NEXT": "preview"
}
},
"preview": {
"on": {
"PREV": "resume"
},
"type": "final"
}
},
"id": "screenerQuestionFirst",
"initial": "sq"
},
"resumeFirst": {
"states": {
"resume": {
"on": {
"NEXT": "sq"
}
},
"sq": {
"on": {
"PREV": "resume",
"NEXT": "preview"
}
},
"preview": {
"on": {
"PREV": "sq"
},
"type": "final"
}
},
"id": "resumeFirst",
"initial": "resume"
}
},
"id": "smartApply",
"initial": "init"
},
{
guards:{
resumeFirst: () => true,
screenerQuestionFirst: ()=> false
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment