Skip to content

Instantly share code, notes, and snippets.

@TheCeloReis
Created August 8, 2021 02:06
Show Gist options
  • Save TheCeloReis/8633ea7b003dc28d9db50d95611068da to your computer and use it in GitHub Desktop.
Save TheCeloReis/8633ea7b003dc28d9db50d95611068da 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)
let from = 1
const fetchMachine = Machine({
id: `chat-${from}`,
initial: 'start',
context: {
retries: 0,
},
states: {
start: {
on: {
PREVIOUS_USER: 'identification',
FIRST_TIME: 'registration',
},
},
identification: {
on: {
USER_FOUND: 'menu',
MISSING_USER: 'identification',
},
},
registration: {
on: {},
},
menu: {
on: {
SCHEDULE_EXAMINE: 'scheduleExamine',
EXAM_RESULT: 'examResult',
COLLECT_SAMPLE: 'collectSample',
},
},
scheduleExamine: {
on: {},
},
examResult: {
on: {},
},
collectSample: {
on: {},
},
},
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment