Skip to content

Instantly share code, notes, and snippets.

@wilcoschoneveld
Last active September 20, 2019 17:18
Show Gist options
  • Save wilcoschoneveld/7703ca540c2336d202051b029b1b6ba1 to your computer and use it in GitHub Desktop.
Save wilcoschoneveld/7703ca540c2336d202051b029b1b6ba1 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({
id: "main",
initial: "home",
states: {
home: {
on: {
LEADERBOARD: "leaderboard",
NEWMATCH: "newMatch"
}
},
leaderboard: {
on: {
BACK: "home"
}
},
newMatch: {
on: {
BACK: "home",
START: "match"
}
},
match: {
on: {
CANCEL: "home",
FINISH: "matchResult"
}
},
matchResult: {
on: {
DONE: "home"
}
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment