Skip to content

Instantly share code, notes, and snippets.

@joelhooks
Last active September 8, 2020 19:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joelhooks/d983bf60fdcf0dddd08b2d898629e1ba to your computer and use it in GitHub Desktop.
Save joelhooks/d983bf60fdcf0dddd08b2d898629e1ba to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
const playerMachine = Machine({
id: 'player',
initial: 'loading',
context: {
retries: 0
},
states: {
loading: {
on: {
PLAY: 'playing',
SUBSCRIBE: 'subscribing',
JOIN: 'joining'
}
},
playing: {
on: {
QUIZ: 'quizzing',
COMPLETE: 'completed',
RATE: 'rating'
}
},
quizzing: {
COMPLETE: 'completed'
},
rating: {
COMPLETE: 'completed'
},
subscribing: {
type: 'final'
},
joining: {
type: 'final'
},
completed: {
type: 'final'
},
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment