Last active
January 2, 2021 19:30
-
-
Save scarabaeus/e2280ff01ff5ab44d9441ee89a785586 to your computer and use it in GitHub Desktop.
DEUS-X Simple Mock Flow - https://xstate.js.org/viz/?gist=e2280ff01ff5ab44d9441ee89a785586
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 fetchMachine = Machine({ | |
id: 'Mock One', | |
initial: 'entryPoint', | |
context: { | |
retries: 0 | |
}, | |
states: { | |
'entryPoint': { | |
on: { | |
'GO_TO_STEP_1': {target: 'step1', actions: [] } | |
} | |
}, | |
step1: { | |
on: { | |
'GO_TO_STEP_2': {target: 'step2', actions: ['GET_STEP_2_DATA'] }, | |
} | |
}, | |
step2: { | |
on: { | |
'GO_TO_SUCCESS': {target: 'success', actions: ['GET_STEP_3_DATA'] }, | |
} | |
}, | |
success: { | |
type: 'final' | |
}, | |
} | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment