Skip to content

Instantly share code, notes, and snippets.

@scarabaeus
Last active September 25, 2020 23:57
Show Gist options
  • Save scarabaeus/b68a8b0956f51ef70f6ea081d62cb559 to your computer and use it in GitHub Desktop.
Save scarabaeus/b68a8b0956f51ef70f6ea081d62cb559 to your computer and use it in GitHub Desktop.
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