Skip to content

Instantly share code, notes, and snippets.

@scarabaeus
Last active January 2, 2021 19:30
Show Gist options
  • Save scarabaeus/e2280ff01ff5ab44d9441ee89a785586 to your computer and use it in GitHub Desktop.
Save scarabaeus/e2280ff01ff5ab44d9441ee89a785586 to your computer and use it in GitHub Desktop.
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