Skip to content

Instantly share code, notes, and snippets.

@Jpadilla1
Last active September 5, 2019 22: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 Jpadilla1/37445348cdfb798fb281007158453981 to your computer and use it in GitHub Desktop.
Save Jpadilla1/37445348cdfb798fb281007158453981 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
const wiseLoadingMachine = Machine({
id: 'wiseLoadingMachine',
initial: 'idle',
context: {
region: null
},
states: {
idle: {
on: {
setTab: 'settingTab'
}
},
settingTab: {
onEntry: 'setRegion'
},
loading: {
initial: 'loadingUISettings',
on: {
setTab: '#wiseLoadingMachine.settingTab'
},
states: {
loadingUISettings: {
invoke: {
src: 'loadUISettings',
onDone: 'loadingSubmittedSpend'
},
},
loadingSubmittedSpend: {
invoke: {
src: 'loadSubmittedSpend',
onDone: '#wiseLoadingMachine.success'
},
}
}
},
success: {
entry: 'setResult',
on: {
setTab: 'settingTab'
}
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment