Skip to content

Instantly share code, notes, and snippets.

@7hny
Created February 22, 2021 19:42
Show Gist options
  • Save 7hny/e8f0e07b0ba55b91a2231d095c72b657 to your computer and use it in GitHub Desktop.
Save 7hny/e8f0e07b0ba55b91a2231d095c72b657 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 fetchMachine = Machine({
id: 'fetch',
initial: 'fetchConfig',
context: {
retries: 0
},
states: {
fetchConfig: {
},
fetchData: {
},
loading: {
},
investment: {
on: {
SHOW_BUILDING: 'building',
}
},
building: {
on: {
SHOW_INVESTMENT: 'investment',
SHOW_APARTMENT: 'apartment',
}
},
apartment: {
on: {
SHOW_INVESTMENT: 'investment',
SHOW_BUILDING: 'building',
}
},
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment