Skip to content

Instantly share code, notes, and snippets.

@kellyjandrews
Last active June 26, 2020 21:40
Show Gist options
  • Save kellyjandrews/06496059c816b94afff35c66c007cd9c to your computer and use it in GitHub Desktop.
Save kellyjandrews/06496059c816b94afff35c66c007cd9c to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
const opentokMachine = Machine({
id: 'opentok',
initial: 'disconnected',
context: {
sessionId: null
},
states: {
disconnected: {
id: 'disconnected',
initial: 'init',
states: {
init: {
entry: ['getToken']
},
ready: {
on: {
'JOIN': '#connected'
}
},
teardown: {
}
}
},
connected: {
id: 'connected',
on: {
'DISCONNECT': '#disconnected.teardown'
}
}
}
}, {
actions:{
getToken: (ctx, e) => console.log('getting token')
}
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment