Last active
April 3, 2020 22:40
-
-
Save patrickporto/86738a237379d3f2137b95d8e9a26112 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
const postCardMachine = Machine({ | |
id: "postCard", | |
type: "parallel", | |
states: { | |
publishing: { | |
initial: "placeholder", | |
states: { | |
operation: { | |
initial: "listing", | |
states: { | |
listing: { | |
on: { MANIPULATE: "manipulation" }, | |
initial: "expanded", | |
states: { | |
expanded: { | |
on: { SHRINK: "shrinked" }, | |
initial: "pending", | |
states: { | |
pending: { | |
on: { PUBLISH: "published", DRAFT: "draft" }, | |
}, | |
published: { | |
on: { DRAFT: "draft" }, | |
}, | |
draft: { | |
on: { | |
PUBLISH: "published", | |
}, | |
}, | |
}, | |
}, | |
shrinked: { | |
on: { EXPAND: "expanded" }, | |
initial: "pending", | |
states: { | |
pending: { | |
on: { PUBLISH: "published", DRAFT: "draft" }, | |
}, | |
published: { | |
on: { DRAFT: "draft" }, | |
}, | |
draft: { | |
on: { | |
PUBLISH: "published", | |
}, | |
}, | |
}, | |
}, | |
}, | |
}, | |
manipulation: { | |
on: { LIST: "listing" }, | |
}, | |
}, | |
}, | |
placeholder: { | |
on: { | |
OPERATION: "operation", | |
}, | |
}, | |
}, | |
}, | |
}, | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment