Last active
November 28, 2020 15:42
-
-
Save AndresRodH/fbd8d2c80587677f159152e175b3835b to your computer and use it in GitHub Desktop.
Example 2
This file contains 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 doTheThingMachine = Machine({ | |
id: 'do-the-thing', | |
initial: 'validating', | |
states: { | |
validating: { | |
invoke: { | |
src: 'validateArgs', | |
onDone: 'handlingThings', | |
onError: { | |
target: 'failure', | |
actions: 'invalidArgsError' | |
} | |
} | |
}, | |
handlingThings: {}, | |
success: { | |
type: 'final', | |
}, | |
failure: { | |
type: 'final', | |
}, | |
}, | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment