Created
January 10, 2020 23:59
-
-
Save tmbtech/742c9e87f08915ff1587b9ac35e6c9c4 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
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