Skip to content

Instantly share code, notes, and snippets.

@zacharysyoung
Created June 6, 2021 22:28
Show Gist options
  • Save zacharysyoung/e3d3bd623311d16f78ac5c68f64ad5d5 to your computer and use it in GitHub Desktop.
Save zacharysyoung/e3d3bd623311d16f78ac5c68f64ad5d5 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
const fetchMachine = Machine({
id: 'distinct & valid',
initial: 'new',
states: {
'new': {
on: {
FOUND_DISTINCT: 'distinct',
FOUND_NOT_DISTINCT: 'no'
}
},
no: { type: 'final' },
distinct: {
on: {
VALIDATE: 'validating'
}
},
validating: {
on: {
FOUND_NOT_VALID: 'no',
FOUND_VALID: 'yes'
}
},
yes: { type: 'final' }
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment