Skip to content

Instantly share code, notes, and snippets.

@tmbtech
Created January 10, 2020 23:59
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 tmbtech/742c9e87f08915ff1587b9ac35e6c9c4 to your computer and use it in GitHub Desktop.
Save tmbtech/742c9e87f08915ff1587b9ac35e6c9c4 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
const Foobar = Machine({
id: 'fetch',
initial: 'loading',
context: {
patientID: null
},
states: {
loading: {
on: {
"": [
{
target: "getPatientID",
cond: "noPatientID"},
{
target: "getPatientProfilePromotionsAndBrands"}
]
}
},
getPatientID: {
onDone: "getPatientProfilePromotionsAndBrands"
},
getPatientProfilePromotionsAndBrands: {}
}
}, {
guards: {
"noPatientID": (context ) => {
return context.patientID === null;
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment