Skip to content

Instantly share code, notes, and snippets.

@fvsch
Created January 5, 2021 17:54
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 fvsch/897990dba921cb329062644d3b551c65 to your computer and use it in GitHub Desktop.
Save fvsch/897990dba921cb329062644d3b551c65 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
const gameMachine = Machine({
id: "game",
initial: "setup",
states: {
setup: {
on: {
START_PLAYING: "playing",
},
},
playing: {
on: {
SHOW_RESULTS: "results",
SHOW_SETUP: "setup",
},
initial: "countdown",
states: {
countdown: {
on: { NEXT: "turn" },
},
turn: {
on: { NEXT: "cooldown" },
},
cooldown: {
on: { NEXT: "turn" },
},
},
},
results: {
on: {
SHOW_SETUP: "setup",
},
},
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment