Last active
September 25, 2020 23:57
-
-
Save scarabaeus/b68a8b0956f51ef70f6ea081d62cb559 to your computer and use it in GitHub Desktop.
Example Single Pole Hit: https://xstate.js.org/viz/?gist=b68a8b0956f51ef70f6ea081d62cb559
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 postMessage = (messageName) => ([messageName]); | |
const fetchMachine = Machine({ | |
id: 'Single Party Pole Hit', | |
initial: 'Claim Created', | |
context: { | |
retries: 0 | |
}, | |
states: { | |
'Claim Created': { | |
on: { | |
goToStep2: {target: 'step1', actions: [] } | |
} | |
}, | |
step1: { | |
on: { | |
goToStep2: {target: 'step2', actions: [] }, | |
} | |
}, | |
step2: { | |
on: { | |
goToStep3: {target: 'step3', actions: ['ASSESSMENT_MESSAGE'] }, | |
} | |
}, | |
step3: { | |
on: { | |
goToStep2: {target: 'step4', actions: [] }, | |
} | |
}, | |
step4: { | |
on: { | |
goToStep2: {target: 'step99', actions: ['REPAIR_MESSAGE'] }, | |
} | |
}, | |
step99: { | |
on: { | |
closeClaim: {target: 'success', actions: ['CLOSE_CLAIM_MESSAGE'] }, | |
} | |
}, | |
success: { | |
type: 'final' | |
}, | |
} | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment