Skip to content

Instantly share code, notes, and snippets.

@laheadle
Last active May 21, 2020 20:07
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 laheadle/a7e807cc38f0fc73222a519f9d7fa8d9 to your computer and use it in GitHub Desktop.
Save laheadle/a7e807cc38f0fc73222a519f9d7fa8d9 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
const m = Machine({
"id": "highlight",
"type": "parallel",
"states": {
"HLAttachment": {
"id": "HLAttachment",
"initial": "unattached",
"states": {
"unattached": {
"id": "unattached",
"on": {
"ATTACH_HL_SO": {
"target": "#attachedToSO"
},
"ATTACH_TO_TO": {
"target": "#attachedToTO"
}
},
"states": {}
},
"attachedToSO": {
"id": "attachedToSO",
"type": "parallel",
"on": {
"DETACH": {
"target": "#unattached"
}
},
"states": {
"HL_AIs": {
"id": "HL_AIs",
"initial": "yellow",
"states": {
"yellow": {
"id": "yellow",
"on": {
"": [
{
"target": "#green",
"in": "#hasAIs"
}
]
},
"states": {}
},
"green": {
"id": "green",
"on": {
"": [
{
"target": "#yellow",
"in": "#noAIs"
}
]
},
"states": {}
}
}
},
"HL_Comment": {
"id": "HL_Comment",
"initial": "no_underline",
"states": {
"underlined": {
"id": "underlined",
"on": {
"": [
{
"target": "#no_underline",
"in": "#noComments"
}
]
},
"states": {}
},
"no_underline": {
"id": "no_underline",
"on": {
"": [
{
"target": "#underlined",
"in": "#hasComments"
}
]
},
"states": {}
}
}
}
}
},
"attachedToTO": {
"on": {
"DETACH": {
"target": "#unattached"
}
},
"id": "attachedToTO",
"states": {}
}
}
},
"studyObjectAIs": {
"id": "studyObjectAIs",
"initial": "noAIs",
"states": {
"noAIs": {
"id": "noAIs",
"on": {
"SO_GOT_AI": {
"target": "#hasAIs"
}
},
"states": {}
},
"hasAIs": {
"id": "hasAIs",
"on": {
"SO_CLEARED_AIS": {
"target": "#noAIs"
}
},
"states": {}
}
}
},
"studyObjectComments": {
"id": "studyObjectComments",
"initial": "noComments",
"states": {
"noComments": {
"on": {
"SO_GOT_COMMENT": {
"target": "#hasComments"
}
},
"id": "noComments",
"states": {}
},
"hasComments": {
"id": "hasComments",
"states": {}
}
}
}
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment