Last active
September 5, 2019 22:02
-
-
Save Jpadilla1/37445348cdfb798fb281007158453981 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
This file contains 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 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