Skip to content

Instantly share code, notes, and snippets.

@tivac
Created February 5, 2020 23:26
Show Gist options
  • Save tivac/ff82c44f19a75d7062a4eb1eadf8b99a to your computer and use it in GitHub Desktop.
Save tivac/ff82c44f19a75d7062a4eb1eadf8b99a to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
const machine = Machine({
id: "menu",
initial: "initialize",
states: {
initialize : {
on : {
CONNECTION : [{
cond : (ctx, { lan }) => lan,
target : "lan",
}, {
target : "booting"
}]
}
},
booting : {
initial : "booting",
on : {
LOBBY : "lobby",
},
states : {
booting : {
on : {
BOOTED : [{
cond : (ctx, { ftue }) => ftue,
target : "ftue"
}, {
cond : (ctx, { banned }) => banned,
target : "banned",
}, {
target : "continue",
}]
}
},
ftue : {},
banned : {},
continue : {
on : {
CLICK : {
actions : raise("LOBBY"),
},
},
},
},
},
lan : {
},
lobby : {
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment