Skip to content

Instantly share code, notes, and snippets.

@rcy
Last active March 30, 2021 23:29
Show Gist options
  • Save rcy/0da046ebf323d717eb8ece1a4801110f to your computer and use it in GitHub Desktop.
Save rcy/0da046ebf323d717eb8ece1a4801110f 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: 'start',
initial: 'start',
context: {
retries: 0
},
states: {
start: {
on: {
COMPLETE_L1: 'l1',
COMPLETE_L2: 'l2'
}
},
l1: {
on: {
EXPIRE: 'l1_expired',
RECERT: 'l1',
COMPLETE_L2: 'l1_l2',
}
},
l1_expired: {
on: {
RECERT: 'l1',
COMPLETE_L2: 'l1_l2',
}
},
l2: {
on: {
EXPIRE: 'l2_expired',
RECERT: 'l2',
COMPLETE_L1: 'l1_l2',
}
},
l2_expired: {
on:{
RECERT: 'l2',
COMPLETE_L1: 'l1_l2'
}
},
l1_l2: {
on: {
EXPIRE: 'l1_l2_expired',
RECERT: 'l1_l2',
}
},
l1_l2_expired: {
on: {
RECERT: 'l1_l2'
}
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment