Created
August 8, 2020 22:29
-
-
Save Andarist/1e8443a7033018d2b489cf2a83c6787b 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
Machine({ | |
initial: 'fetching_user', | |
states: { | |
fetching_user: { | |
invoke: { | |
src: 'fetchUser', | |
onDone: [{ | |
cond: 'hasUser', | |
target: 'fetching_resources' | |
}, { | |
target: 'idle' | |
}], | |
onError: 'failed' | |
} | |
}, | |
fetching_resources: { | |
type: 'parallel', | |
states: { | |
fetching_projects: { | |
initial: 'fetching', | |
states: { | |
fetching: { | |
invoke: { | |
src: 'fetchProjects', | |
onDone: 'done', | |
onError: '#failed' | |
} | |
}, | |
done: { | |
type: 'final' | |
} | |
} | |
}, | |
fetching_metrics: { | |
initial: 'fetching', | |
states: { | |
fetching: { | |
invoke: { | |
src: 'fetchMetrics', | |
onDone: 'done', | |
onError: '#failed' | |
} | |
}, | |
done: { | |
type: 'final' | |
} | |
} | |
}, | |
fetching_profiles: { | |
initial: 'fetching', | |
states: { | |
fetching: { | |
invoke: { | |
src: 'fetchProfiles', | |
onDone: 'done', | |
onError: '#failed' | |
} | |
}, | |
done: { | |
type: 'final' | |
} | |
} | |
}, | |
fetching_sources: { | |
initial: 'fetching', | |
states: { | |
fetching: { | |
invoke: { | |
src: 'fetchSources', | |
onDone: 'done', | |
onError: '#failed' | |
} | |
}, | |
done: { | |
type: 'final' | |
} | |
} | |
} | |
}, | |
onDone: 'success' | |
}, | |
idle: { | |
type: 'final' | |
}, | |
success: { | |
type: 'final', | |
onEntry: 'initSuccess' | |
}, | |
failed: { | |
id: 'failed', | |
type: 'final', | |
onEntry: 'initFail' | |
} | |
} | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment