Last active
September 22, 2019 23:32
-
-
Save gltovar/815b6c93b8aa1e7c27e673a0bdacb788 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
This file contains 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
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions | |
// - XState (all XState exports) | |
const contestantInfoPreshow = Machine({ | |
id: 'contestantInfoPreshow', | |
initial: 'idle', | |
context: { | |
ready: false | |
}, | |
states: { | |
idle:{ | |
on: { | |
RECEIVE_INFO: 'displayInfo' | |
} | |
}, | |
displayInfo: { | |
on:{ | |
TOGGLE_READY:{ | |
target:"displayInfo", | |
actions: assign({ | |
ready: (context, event) => !(context.ready) | |
}) | |
} | |
} | |
} | |
} | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment