Skip to content

Instantly share code, notes, and snippets.

@joelhooks
Last active Sep 8, 2020
Embed
What would you like to do?
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