Skip to content

Instantly share code, notes, and snippets.

@Fi1osof
Last active June 10, 2022 08:12
Show Gist options
  • Save Fi1osof/ea0f54362be02261100bca11b59ebf39 to your computer and use it in GitHub Desktop.
Save Fi1osof/ea0f54362be02261100bca11b59ebf39 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: 'DataFlowMachine',
initial: 'idle',
context: {},
states: {
idle: {
on: {
changedExternalThing: 'processingDataFlow',
changedMasterData: 'processingDataFlow',
triggerByTimer: 'processingDataFlow',
},
},
processingDataFlow: {
initial: 'findingWorkFlow',
states: {
findingWorkFlow: {
on: {
finded: 'processingWorkFlow',
missed: 'error',
},
},
processingWorkFlow: {
initial: 'findingCondition',
states: {
findingCondition: {
on: {
finded: 'processingCondition',
missed: 'error',
},
},
processingCondition: {
initial: 'executing',
states: {
executing: {
on: {
success: 'complete',
failed: 'error',
},
},
complete: {},
error: {},
},
},
error: {},
},
},
error: {},
},
},
applyingDataMaps: {
states: {
processing: {
on: {
success: 'success',
error: 'failed',
},
},
success: {},
failed: {},
},
},
error: {},
},
on: {
filter: "processingDataFlow"
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment