Skip to content

Instantly share code, notes, and snippets.

@KyleAMathews
Created April 12, 2021 21:33
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save KyleAMathews/74fce04f8c255a5eccd7170ca059ff86 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 previewLoaderMachine = Machine({
id: 'previewLoader',
initial: 'request',
context: {
ERROR: ''
},
states: {
request: {
on: {
IDLE_HAS_PAGE: 'redirect',
HAS_ERROR: 'frontend_with_error',
NOT_IDLE: 'frontend'
}
},
frontend: {
on: {
IDLE_HAS_PAGE: 'redirect',
HAS_ERROR: 'frontend_with_error',
}
},
frontend_with_error: {
type: 'final'
},
redirect: {
type: 'final'
},
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment