Skip to content

Instantly share code, notes, and snippets.

@wwhurley
Last active October 9, 2019 17:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wwhurley/db387b033508a98d0a1ff9c3ce8a484c to your computer and use it in GitHub Desktop.
Save wwhurley/db387b033508a98d0a1ff9c3ce8a484c to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
// - XState (all XState exports)
const fetchMachine = Machine({
id: 'transaction',
initial: 'Open',
context: {
retries: 0
},
states: {
Open: {
on: {
REVIEW: 'FollowUp',
FALSEPOSITIVE: 'Complete',
NOREVIEWNEEDED: 'Complete',
}
},
FollowUp: {
on: {
REMEDIATIONREQUIRED: 'Remediation',
REMEDIATIONNOTREQUIRED: 'Complete',
REFERRED: 'Complete',
NOISSUECLOSED: 'Complete',
NOISSUEREFERRED: 'Complete',
SAVE: {},
},
type: 'parallel',
initial: 'Active',
states: {
Active: {
on: {
DELETE: 'Deleted',
SAVE: {},
},
},
Deleted: {
type: 'final'
}
},
},
Remediation: {
type: 'parallel',
initial: 'Active',
states: {
Active: {
on: {
DELETE: 'Deleted',
SAVE: {},
},
},
Deleted: {
type: 'final',
}
},
on: {
SUBMIT: 'Complete',
SAVE: {},
}
},
Complete: {
type: 'final'
},
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment