Last active
June 24, 2020 16:07
-
-
Save kellyjandrews/9b6424526377fd7a9e1bf665180aefb7 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 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