Last active
June 26, 2020 21:40
-
-
Save kellyjandrews/06496059c816b94afff35c66c007cd9c to your computer and use it in GitHub Desktop.
Revisions
-
kellyjandrews revised this gist
Jun 26, 2020 . 1 changed file with 15 additions and 14 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,6 @@ const promise = (ctx, e) => new Promise((resolve, reject) => { console.log('got called') resolve('done'); }); const opentokMachine = Machine({ @@ -14,26 +15,25 @@ const opentokMachine = Machine({ initial: 'init', states: { init: { invoke: { id: 'getToken', src: 'invokeGetToken', onDone: { target: "ready", actions: 'logToken' } }, entry: [ 'initSession', 'initPublisher' ] }, ready: { on: { 'JOIN': '#connected' } }, teardown: {} } }, connected: { @@ -45,11 +45,12 @@ const opentokMachine = Machine({ } }, { actions:{ logToken: (ctx, e) => console.log('get token'), initSession: (ctx, e) => console.log('initSession'), initPublisher: (ctx, e) => console.log('initPublisher') }, services: { invokeGetToken: async (ctx, e) => await promise() } } ); -
kellyjandrews revised this gist
Jun 26, 2020 . 1 changed file with 13 additions and 5 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ let promise = new Promise(function(resolve, reject) { return setTimeout(() => resolve("done"), 1000); }); const opentokMachine = Machine({ @@ -15,10 +15,16 @@ const opentokMachine = Machine({ states: { init: { entry: [ 'initSession', 'initPublisher' ], invoke: { id: 'getToken', src: 'getToken', onDone: { actions: () => console.log('get token') } } }, ready: { on: { @@ -39,9 +45,11 @@ const opentokMachine = Machine({ } }, { actions:{ initSession: (ctx, e) => console.log('initSession'), initPublisher: (ctx, e) => console.log('initPublisher') }, service: { getToken: async (ctx, e) => await promise() } } ); -
kellyjandrews revised this gist
Jun 26, 2020 . 1 changed file with 4 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,6 @@ const getToken = (ctx, e) => new Promise((res, rej) => { return setTimeout(res(console.log('getToken')), 500); }); const opentokMachine = Machine({ id: 'opentok', @@ -36,7 +39,7 @@ const opentokMachine = Machine({ } }, { actions:{ getToken: getToken, initSession: (ctx, e) => console.log('initSession'), initPublisher: (ctx, e) => console.log('initPublisher') } -
kellyjandrews revised this gist
Jun 26, 2020 . 1 changed file with 8 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -11,7 +11,11 @@ const opentokMachine = Machine({ initial: 'init', states: { init: { entry: [ 'getToken', 'initSession', 'initPublisher' ] }, ready: { on: { @@ -32,7 +36,9 @@ const opentokMachine = Machine({ } }, { actions:{ getToken: (ctx, e) => console.log('getting token'), initSession: (ctx, e) => console.log('initSession'), initPublisher: (ctx, e) => console.log('initPublisher') } } ); -
kellyjandrews revised this gist
Jun 26, 2020 . 1 changed file with 11 additions and 7 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -2,33 +2,37 @@ 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') } } ); -
kellyjandrews revised this gist
Jun 26, 2020 . 1 changed file with 18 additions and 4 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,17 +1,31 @@ const opentokMachine = Machine({ id: 'opentok', initial: 'disconnected', context: {}, states: { disconnected: { id: 'disconnected', initial: 'ready', states: { coming: { }, ready: { on: { 'JOIN': '#connected' } }, going: { } } }, connected: { id: 'connected', on: { 'DISCONNECT': '#disconnected.going' } } } }, { -
kellyjandrews revised this gist
Jun 26, 2020 . 1 changed file with 0 additions and 5 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -6,11 +6,6 @@ const opentokMachine = Machine({ states: { disconnected: { id: 'disconnected', on: { "CONNECT": 'connected' } -
kellyjandrews revised this gist
Jun 26, 2020 . 1 changed file with 5 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -6,6 +6,11 @@ const opentokMachine = Machine({ states: { disconnected: { id: 'disconnected', initial: 'idle', states: { idle: {}, ready: {} }, on: { "CONNECT": 'connected' } -
kellyjandrews revised this gist
Jun 26, 2020 . 1 changed file with 6 additions and 11 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -2,22 +2,17 @@ const opentokMachine = Machine({ id: 'openTok', initial: 'disconnected', context: {}, states: { disconnected: { id: 'disconnected', on: { "CONNECT": 'connected' } }, connected: { id: 'connected' } } }, { actions:{} -
kellyjandrews revised this gist
Jun 26, 2020 . 1 changed file with 4 additions and 22 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ const opentokMachine = Machine({ id: 'openTok', initial: 'disconnected', context: { sessionId: null, @@ -17,27 +17,9 @@ const opentokMachine = Machine({ "JOIN": 'join' } }, connected: {} } }, { actions:{} } ); -
kellyjandrews revised this gist
Jun 26, 2020 . No changes.There are no files selected for viewing
-
kellyjandrews revised this gist
Jun 26, 2020 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -22,6 +22,7 @@ const opentokMachine = Machine({ states: { pending: { invoke: { id: 'createSession', src: (ctx, e) => createSession(), onDone: { target: '#meeting.join' -
kellyjandrews revised this gist
Jun 26, 2020 . 1 changed file with 8 additions and 6 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -21,12 +21,14 @@ const opentokMachine = Machine({ initial: 'pending', states: { pending: { invoke: { src: (ctx, e) => createSession(), onDone: { target: '#meeting.join' }, onError: { target: 'failure' } } }, failure: {} -
kellyjandrews revised this gist
Jun 26, 2020 . 1 changed file with 17 additions and 3 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ const opentokMachine = Machine({ id: 'meeting', initial: 'disconnected', context: { sessionId: null, name: null, @@ -11,13 +11,27 @@ const opentokMachine = Machine({ streams: null }, states: { disconnected: { on: { "CREATE": 'create', "JOIN": 'join' } }, create: { initial: 'pending', states: { pending: { invoke: (ctx, e) => createSession(), onDone: { target: '#meeting.join' }, onError: { target: 'failure' } }, failure: {} } }, join: {}, connected: {} } -
kellyjandrews created this gist
Jun 26, 2020 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,26 @@ const opentokMachine = Machine({ id: 'meeting', initial: 'idle', context: { sessionId: null, name: null, token: null, session: null, publisher: null, streams: null }, states: { idle: { on: { "CREATE": 'create', "JOIN": 'join' } }, create: {}, join: {}, connected: {} } } );