Skip to content

Instantly share code, notes, and snippets.

@tivac
Created February 6, 2020 07:43
Show Gist options
  • Save tivac/f356e2d494496f820b38b03d959c7ccc to your computer and use it in GitHub Desktop.
Save tivac/f356e2d494496f820b38b03d959c7ccc to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
const menuMachine = Machine({
id : "menu",
initial : "booting",
states : {
booting : {
on : {
// First-time client launches with services
BOOTING_FTUE : "ftue",
BOOTING_CONTINUE : "continue",
BOOTED_OFFLINE : "offline",
BOOTED_ONLINE : "online",
},
meta : {
test : async () => {
// TODO: ???
},
},
},
continue : {
CONTINUE_CLICK : "online",
meta : {
test : async () => {
},
},
},
ftue : {
initial : "idle",
states : {
idle : {
on : {
FTUE_CONFIRM : "loadout",
},
meta : {
test : async () => {
},
},
},
loadout : {
on : {
FTUE_LOADOUT_CONFIRM : "done",
},
meta : {
test : async () => {
},
},
},
done : {
type : "final",
},
},
onDone : "online",
},
offline : {
meta : {
test : async () => {
},
},
},
online : {
meta : {
test : async () => {
},
},
},
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment