Last active
September 11, 2021 06:54
-
-
Save JayBee007/422e0625c0d8b0a5cda75581dda7b3d3 to your computer and use it in GitHub Desktop.
Revisions
-
JayBee007 revised this gist
Sep 11, 2021 . 1 changed file with 12 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 @@ -21,13 +21,20 @@ const timerMachine = Machine({ }, }, on: { TICK: { actions: assign({ secondsLeft: (ctx) => ctx.secondsLeft - 1 }) } }, states: { round: { on: { '': { target: 'interval', cond: (ctx) => ctx.secondsLeft < 0 } } }, interval: {} }, -
JayBee007 revised this gist
Sep 11, 2021 . 1 changed file with 5 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 @@ -20,13 +20,14 @@ const timerMachine = Machine({ return () => clearInterval(timerId) }, }, on: { TICK: { entry: () => console.log('tick') } }, states: { round: { }, interval: {} }, -
JayBee007 revised this gist
Sep 11, 2021 . 1 changed file with 5 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 @@ -22,7 +22,11 @@ const timerMachine = Machine({ }, states: { round: { on: { TICK: { entry: () => console.log('tick') } } }, interval: {} }, -
JayBee007 revised this gist
Sep 11, 2021 . 1 changed file with 12 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 @@ -11,8 +11,19 @@ const timerMachine = Machine({ }, running: { initial: 'round', invoke: { src: () => (cb) => { let timerId = setInterval(() => { cb('TICK') }, 1000) return () => clearInterval(timerId) }, }, states: { round: { }, interval: {} }, on: { -
JayBee007 revised this gist
Sep 11, 2021 . 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 @@ -10,6 +10,11 @@ const timerMachine = Machine({ } }, running: { initial: 'round', states: { round: {}, interval: {} }, on: { PAUSED: { target: 'paused' -
JayBee007 revised this gist
Sep 11, 2021 . 1 changed file with 1 addition 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 @@ -9,7 +9,7 @@ const timerMachine = Machine({ } } }, running: { on: { PAUSED: { target: 'paused' -
JayBee007 revised this gist
Sep 11, 2021 . No changes.There are no files selected for viewing
-
JayBee007 revised this gist
Sep 11, 2021 . 1 changed file with 3 additions and 18 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 timerMachine = Machine({ id: 'timerMachine', initial: "paused", states: { paused: { on: { @@ -9,27 +9,12 @@ const timerMachine = Machine({ } } }, runnnig: { on: { PAUSED: { target: 'paused' } } } } }) -
JayBee007 revised this gist
Sep 11, 2021 . 1 changed file with 13 additions and 12 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,24 +11,25 @@ const timerMachine = Machine({ }, running: { intial: 'round', states: { round: {}, interval: {} }, on: { PAUSED: { target: 'paused' } }, // invoke: { // src: () => (cb) => { // let timerId = setInterval(() => { // cb('TICK') // },1000) // return () => clearInterval(timerId) // }, // }, } } }) -
JayBee007 revised this gist
Sep 11, 2021 . No changes.There are no files selected for viewing
-
JayBee007 revised this gist
Sep 11, 2021 . 1 changed file with 5 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 @@ -3,7 +3,11 @@ const timerMachine = Machine({ initial: 'paused', states: { paused: { on: { START: { target: 'running' } } }, running: { intial: 'round', -
JayBee007 revised this gist
Sep 11, 2021 . 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 @@ -7,6 +7,11 @@ const timerMachine = Machine({ }, running: { intial: 'round', on: { PAUSED: { target: 'paused' } }, invoke: { src: () => (cb) => { let timerId = setInterval(() => { -
JayBee007 revised this gist
Sep 11, 2021 . 1 changed file with 9 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 @@ -7,6 +7,15 @@ const timerMachine = Machine({ }, running: { intial: 'round', invoke: { src: () => (cb) => { let timerId = setInterval(() => { cb('TICK') },1000) return () => clearInterval(timerId) }, }, states: { round: {}, interval: {} -
JayBee007 revised this gist
Sep 11, 2021 . 1 changed file with 4 additions and 38 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,49 +1,15 @@ const timerMachine = Machine({ id: 'timerMachine', initial: 'paused', states: { paused: { }, running: { intial: 'round', states: { round: {}, interval: {} } } } -
JayBee007 revised this gist
Sep 11, 2021 . 1 changed file with 5 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 @@ -16,22 +16,24 @@ const timerMachine = Machine({ invoke: { src: () => (cb) => { let timerId = setInterval(() => { console.log('setInterval') cb('TICK') }, 1000) return () => clearInterval(timerId) }, }, on: { PAUSED: { target: 'paused' }, TICK: { entry: () => console.log('tick') }, }, initial: 'round', states: { round: { on: { '':{ target: 'interval', cond: (ctx) => ctx.secondsLeft < 0 -
JayBee007 revised this gist
Sep 11, 2021 . 1 changed file with 4 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 @@ -31,12 +31,13 @@ const timerMachine = Machine({ on: { TICK: { entry: () => console.log('tick') }, '':{ target: 'interval', cond: (ctx) => ctx.secondsLeft < 0 } }, }, interval: { -
JayBee007 revised this gist
Sep 11, 2021 . 1 changed file with 6 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 @@ -24,14 +24,16 @@ const timerMachine = Machine({ PAUSED: { target: 'paused' }, }, initial: 'round', states: { round: { on: { TICK: { entry: () => console.log('tick') } }, '':{ target: 'interval', cond: (ctx) => ctx.secondsLeft < 0 } -
JayBee007 revised this gist
Sep 11, 2021 . 1 changed file with 3 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 @@ -24,6 +24,9 @@ const timerMachine = Machine({ PAUSED: { target: 'paused' }, TICK: { entry: () => console.log('tick') } }, initial: 'round', states: { -
JayBee007 revised this gist
Sep 11, 2021 . 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 @@ -28,7 +28,10 @@ const timerMachine = Machine({ initial: 'round', states: { round: { always:{ target: 'interval', cond: (ctx) => ctx.secondsLeft < 0 } }, interval: { -
JayBee007 revised this gist
Sep 11, 2021 . 1 changed file with 1 addition 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 @@ -23,7 +23,7 @@ const timerMachine = Machine({ on: { PAUSED: { target: 'paused' }, }, initial: 'round', states: { -
JayBee007 revised this gist
Sep 11, 2021 . 1 changed file with 7 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 @@ -13,6 +13,13 @@ const timerMachine = Machine({ } }, running: { invoke: { src: () => (cb) => { let timerId = setInterval(() => { cb('TICK') }, 1000) }, }, on: { PAUSED: { target: 'paused' -
JayBee007 revised this gist
Sep 11, 2021 . 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 @@ -13,6 +13,11 @@ const timerMachine = Machine({ } }, running: { on: { PAUSED: { target: 'paused' } }, initial: 'round', states: { round: { -
JayBee007 revised this gist
Sep 11, 2021 . 1 changed file with 9 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 @@ -13,7 +13,15 @@ const timerMachine = Machine({ } }, running: { initial: 'round', states: { round: { }, interval: { } } } } }) -
JayBee007 revised this gist
Sep 11, 2021 . 1 changed file with 1 addition and 27 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 @@ -13,33 +13,7 @@ const timerMachine = Machine({ } }, running: { } } }) -
JayBee007 revised this gist
Sep 11, 2021 . 1 changed file with 3 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 @@ -27,11 +27,13 @@ const timerMachine = Machine({ initial: 'round', states: { round: { on: { TICK: { actions: assign({ secondsLeft: (ctx) => ctx.secondsLeft - 1 }) } } } }, interval: { -
JayBee007 revised this gist
Sep 11, 2021 . 1 changed file with 4 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 @@ -13,6 +13,10 @@ const timerMachine = Machine({ } }, running: { on: { PAUSED: { target: 'paused' }, invoke: { src: () => (cb) => { let timerId = setInterval(() => { @@ -23,10 +27,6 @@ const timerMachine = Machine({ initial: 'round', states: { round: { TICK: { actions: assign({ secondsLeft: (ctx) => ctx.secondsLeft - 1 -
JayBee007 revised this gist
Sep 11, 2021 . 1 changed file with 13 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,6 +1,9 @@ const timerMachine = Machine({ id: 'timerMachine', initial: 'paused', context: { secondsLeft: 5 }, states: { paused: { on: { @@ -20,7 +23,16 @@ const timerMachine = Machine({ initial: 'round', states: { round: { on: { PAUSED: { target: 'paused' }, TICK: { actions: assign({ secondsLeft: (ctx) => ctx.secondsLeft - 1 }) } } }, interval: { -
JayBee007 created this gist
Sep 11, 2021 .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,31 @@ const timerMachine = Machine({ id: 'timerMachine', initial: 'paused', states: { paused: { on: { START: { target: 'running' } } }, running: { invoke: { src: () => (cb) => { let timerId = setInterval(() => { cb('TICK') }, 1000) } }, initial: 'round', states: { round: { }, interval: { } } } } })