Skip to content

Instantly share code, notes, and snippets.

@svagi
Created May 8, 2020 18:05
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 svagi/8aef8cebba32f00b9e0e9e7ca28a21d2 to your computer and use it in GitHub Desktop.
Save svagi/8aef8cebba32f00b9e0e9e7ca28a21d2 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
// - XState (all XState exports)
const fetchStates = {
initial: 'loading',
states: {
loading: {
on: {
RESOLVE: 'resolved',
REJECT: 'rejected'
}
},
resolved: {
type: 'final'
},
rejected: {
type: 'final'
}
}
};
const appMachine = Machine({
id: 'app',
initial: 'idle',
states: {
"idle": {
on: {
"": "app-loading"
}
},
"app-loading":{
type: "parallel",
states: {
"toggle-loading": fetchStates,
"db-def-loading": fetchStates
},
onDone: "app-render",
},
"app-render": {
type: "parallel",
states: {
"ds-loading": fetchStates,
"fields-loading": fetchStates
}
}
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment