Last active
March 22, 2020 19:02
-
-
Save devstojko/69c6d25a431063626309abec3978c3bb to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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