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 characters
| const terminationFormMachine = Machine({ | |
| id: 'terminationForm', | |
| initial: 'initial', | |
| states: { | |
| initial: { | |
| on: { | |
| MANAGER_SAVE: 'saved' | |
| } |
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 characters
| const formMachine = Machine({ | |
| id: 'form', | |
| initial: 'initial', | |
| states: { | |
| initial: { | |
| on: { | |
| MANAGER_SAVE: 'saved' | |
| } |
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 characters
| const ONE_SECOND = 1000; | |
| const ONE_MINUTE = ONE_SECOND * 60; | |
| const machine = Machine( | |
| { | |
| id: 'microwave', | |
| initial: 'idle', | |
| context: { |
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 characters
| const stoplightMachine = Machine({ | |
| initial: 'red', | |
| states: { | |
| red: { | |
| after: { | |
| 3000: 'green' | |
| } | |
| }, | |
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 characters
| const increment = context => context.count + 1; | |
| const decrement = context => context.count - 1; | |
| const reset = context => context.count = 0; | |
| const counterMachine = Machine({ | |
| initial: 'active', | |
| context: { | |
| count: 0 | |
| }, |