Skip to content

Instantly share code, notes, and snippets.

@kellyjandrews
Last active June 24, 2020 16:07
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 kellyjandrews/9b6424526377fd7a9e1bf665180aefb7 to your computer and use it in GitHub Desktop.
Save kellyjandrews/9b6424526377fd7a9e1bf665180aefb7 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
const videoMachine = Machine({
id: 'video',
initial: 'disconnected',
context: {},
states: {
disconnected: {
on: {
JOIN: 'initialize'
}
},
initialize: {
invoke: {
id: 'initSessionAndToke',
onDone: 'connected',
onError: '#video.error'
}
},
connected: {
type: 'paralell',
states: {
subscribed: {
invoke: {
id: 'observeStreams',
onError: '#video.error'
},
},
published: {
invoke: {
id: 'connectAndPublish',
onError: '#video.error'
}
}
},
on: {
LEAVE: '#video.disconnected'
}
},
error: {}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment