Created
February 5, 2020 23:26
-
-
Save tivac/ff82c44f19a75d7062a4eb1eadf8b99a to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
This file contains hidden or 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 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