Skip to content

Instantly share code, notes, and snippets.

@tclain
Created April 6, 2021 19:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tclain/928fabd4d0fe350fb4a4693adbc73b0f to your computer and use it in GitHub Desktop.
Save tclain/928fabd4d0fe350fb4a4693adbc73b0f 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 bookingMachine = Machine({
id: 'fetch',
initial: 'idle',
context: {
retries: 0
},
states: {
idle: {
on: {
START_BOOKING: 'clinicSelector'
}
},
clinicSelector: {
on: {
NOT_SUPPORTED: 'registerInterest',
NEXT: 'companyInformation'
}
},
registerInterest: {
on: {
SAVED: 'thankYou'
}
},
thankYou: {},
companyInformation: {
on: {
NEXT: 'authInformation',
BACK: 'clinicSelector'
}
},
authInformation: {
on: {
NEXT: 'location',
BACK: 'clinicSelector'
}
},
location: {
on: {
NEXT: 'profileInformation',
BACK: 'authInformation'
}
},
profileInformation: {
on: {
NEXT: 'tcs',
BACK: 'location'
}
},
tcs: {
on: {
NEXT: 'checkEmail',
BACK: 'profileInformation'
}
},
checkEmail: {
on: {
}
},
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment