Skip to content

Instantly share code, notes, and snippets.

@arielferdman
Created October 30, 2021 12:01
Show Gist options
  • Save arielferdman/ddcd2abe71f2afcfbe903a0a4b733560 to your computer and use it in GitHub Desktop.
Save arielferdman/ddcd2abe71f2afcfbe903a0a4b733560 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: 'fetch',
initial: 'start',
context: {
retries: 0
},
states: {
start: {
on: {
DEFAULT: 'least'
}
},
least: {
on: {
LASTDIGIT: 'middle',
NOTLASTDIGIT: 'done'
}
},
middle: {
on: {
LASTDIGIT: 'most',
NOLASTDIGIT: 'done'
}
},
most: {
on: {
DEFAULT: 'done'
}
},
done: {
type: 'final'
},
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment