Created
December 15, 2020 04:22
-
-
Save ChristianMurphy/713ab0954f00977b19ab04842bae2bf7 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Machine( | |
{ | |
id: "unified", | |
type: "parallel", | |
states: { | |
phase: { | |
initial: "new", | |
states: { | |
new: { | |
entry: ["addTag(phase/new)"], | |
on: { | |
status: { | |
target: "invalid", | |
cond: "closed", | |
}, | |
}, | |
}, | |
open: {}, | |
invalid: { | |
entry: ["removeTag(*)", "addTag(phase/invalid)"], | |
on: { | |
status: { | |
target: "no", | |
cond: "reopen", | |
}, | |
}, | |
}, | |
no: { | |
entry: ["removeTag(*)", "addTag(phase/no)"], | |
}, | |
}, | |
}, | |
template: { | |
initial: "missing", | |
states: { | |
missing: { | |
entry: ["comment(missing-template)"], | |
on: { | |
edit: [ | |
{ | |
target: "correct", | |
cond: "correct", | |
}, | |
{ | |
target: "incorrect", | |
cond: "incorrect", | |
}, | |
], | |
}, | |
}, | |
correct: { | |
on: { | |
edit: [ | |
{ | |
target: "missing", | |
cond: "missing", | |
}, | |
{ | |
target: "incorrect", | |
cond: "incorrect", | |
}, | |
], | |
}, | |
}, | |
incorrect: { | |
on: { | |
edit: [ | |
{ | |
target: "missing", | |
cond: "missing", | |
}, | |
{ | |
target: "correct", | |
cond: "correct", | |
}, | |
], | |
}, | |
}, | |
}, | |
}, | |
}, | |
}, | |
{ | |
guards: { | |
closed: () => true, | |
reopen: () => true, | |
correct: () => false, | |
incorrect: () => true, | |
missing: () => true, | |
}, | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment