Skip to content

Instantly share code, notes, and snippets.

@devstojko
Last active March 22, 2020 19:02
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 devstojko/69c6d25a431063626309abec3978c3bb to your computer and use it in GitHub Desktop.
Save devstojko/69c6d25a431063626309abec3978c3bb 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 trip = {
companyName: '',
accommodations: []
}
const basketMachine = Machine({
id: 'basketMachine',
initial: 'stepOne',
context: {
allowedCompany: null,
routes: [trip],
hasSelectedRoutes: false,
},
states: {
stepOne: {
selectRoutes: {
},
},
stepTwo: {
initial: 'selectAccommodation',
states: {
priceCalculation: {
},
proceed: {
}
}
},
}
},
{
guards: {
hasSelectedRoutes: () => false
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment