Skip to content

Instantly share code, notes, and snippets.

View kellyjandrews's full-sized avatar
I don't get it.

Kelly J Andrews kellyjandrews

I don't get it.
View GitHub Profile
@kellyjandrews
kellyjandrews / machine.js
Last active July 9, 2020 16:40
Generated by XState Viz: https://xstate.js.org/viz
const stream = Machine(
{
id: 'stream',
initial: 'connected',
context: {
stream: null,
hasAudio: true,
hasVideo: true,
videoSrcObject: null,
audioLevel: {
@kellyjandrews
kellyjandrews / machine.js
Last active July 9, 2020 16:40
Generated by XState Viz: https://xstate.js.org/viz
const session = Machine({
id: 'session',
initial: 'disconnected',
context: {
sessionId: null,
session: null,
token: null,
publisher: null,
subscribers: new Map()
},
@kellyjandrews
kellyjandrews / machine.js
Last active July 2, 2020 13:21
Generated by XState Viz: https://xstate.js.org/viz
const video = Machine({
id: 'video',
initial: 'disconnected',
context: {
sessionId: null,
session: null,
publisher: null,
streams: null,
token: null
},
@kellyjandrews
kellyjandrews / machine.js
Last active June 30, 2020 04:58
Generated by XState Viz: https://xstate.js.org/viz
const video = Machine({
id: 'video',
initial: 'disconnected',
states: {
disconnected: {
id: 'disconnected',
initial: 'idle',
states: {
'idle': {
id: 'idle',
@kellyjandrews
kellyjandrews / machine.js
Last active June 30, 2020 03:59
Generated by XState Viz: https://xstate.js.org/viz
const video = Machine({
id: 'video',
initial: 'disconnected',
states: {
disconnected: {
id: 'disconnected',
initial: 'idle',
states: {
'idle': {},
'init': {},
@kellyjandrews
kellyjandrews / machine.js
Last active June 29, 2020 18:03
Generated by XState Viz: https://xstate.js.org/viz
const video = Machine({
id: 'video',
initial: 'disconnected',
states: {
disconnected: {
id: 'disconnected',
initial: 'idle',
states: {
'idle': {},
'init': {},
@kellyjandrews
kellyjandrews / machine.js
Last active June 29, 2020 17:35
Generated by XState Viz: https://xstate.js.org/viz
const video = Machine({
id: 'video',
initial: 'disconnected',
states: {
disconnected: {},
connected: {}
}
});
const lightBulb = Machine({
id: 'lightBulb',
initial: 'off',
states: {
off: {
on: {
TURN_ON: 'on'
}
},
on: {
@kellyjandrews
kellyjandrews / machine.js
Last active June 26, 2020 21:40
Generated by XState Viz: https://xstate.js.org/viz
const promise = (ctx, e) => new Promise((resolve, reject) => {
console.log('got called')
resolve('done');
});
const opentokMachine = Machine({
id: 'opentok',
initial: 'disconnected',
context: {
sessionId: null
@kellyjandrews
kellyjandrews / machine.js
Last active June 26, 2020 13:28
Generated by XState Viz: https://xstate.js.org/viz
const opentokMachine = Machine({
id: 'meeting',
initial: 'entry',
context: {
sessionId: null,
name: null,
token: null,
session: null,
publisher: null,
streams: null