Skip to content

Instantly share code, notes, and snippets.

@mset
Last active January 10, 2020 15:10
Show Gist options
  • Save mset/b32ab41a9de464b743fb140956becdf9 to your computer and use it in GitHub Desktop.
Save mset/b32ab41a9de464b743fb140956becdf9 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: 'GDPR Request',
initial: 'Draft',
context: {
retries: 0
},
states: {
Draft: {
on: {
'ASSIGN TO DPO': 'New'
}
},
New: {
on: {
START: 'In Progress',
'WITHDRAW': 'Withdrawn'
}
},
'In Progress': {
on: {
'STOP THE CLOCK': 'On Hold',
'CLOSE': 'Closed',
'WITHDRAW': 'Withdrawn'
}
},
'On Hold': {
on: {
'RESTART THE CLOCK': 'In Progress',
'WITHDRAW': 'Withdrawn'
}
},
'Closed': {
type: 'final'
},
'Withdrawn': {
type: 'final'
},
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment