Last active
May 3, 2020 21:56
-
-
Save rootart/d1ecbba7c2d4b5c6cfc76d82a2773e24 to your computer and use it in GitHub Desktop.
Revisions
-
Vasyl Dizhak revised this gist
May 3, 2020 . 1 changed file with 10 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 @@ -3,6 +3,16 @@ const triathlonMachine = Machine( { id: 'triathlonMachine', initial: 'idle', context: { startTime: null, transitionOneStart: null, cyclingLegStart: null, transitionTwoStart: null, runningLegStart: null, finishEnd: null, dnfTime: null, }, on: { PULL_OUT: 'dnf', cond: () => {} -
Vasyl Dizhak revised this gist
May 3, 2020 . 1 changed file with 4 additions and 8 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,10 +1,11 @@ const triathlonMachine = Machine( { id: 'triathlonMachine', initial: 'idle', on: { PULL_OUT: 'dnf', cond: () => {} }, states: { @@ -31,18 +32,13 @@ const triathlonMachine = Machine( }, running: { on: { FINISH: '#triathlonMachine.finished', PULL_OUT: '#triathlonMachine.dnf', } } } } } } ) -
Vasyl Dizhak created this gist
May 3, 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,48 @@ const triathlonMachine = Machine( { id: 'triathlonMachine', initial: 'idle', on: { PULL_OUT: 'dnf', cond: 'isActive' }, states: { idle: { on: { START: 'active.swimming', } }, dnf: {}, finished: {}, active: { states: { swimming: { on: { TRANSITION: 'cycling', PULL_OUT: '#triathlonMachine.dnf', } }, cycling: { on: { TRANSITION: 'running', PULL_OUT: '#triathlonMachine.dnf', } }, running: { on: { FINISH: '#triathlonMachine.finishisActiveed', PULL_OUT: '#triathlonMachine.dnf', } } } } } }, { guards: { isActive: function() {} } } );