Skip to content

Instantly share code, notes, and snippets.

@thangngoc89
Last active November 10, 2019 17:53
Show Gist options
  • Save thangngoc89/5cb6ed437584885aa6bcf44719cc59e9 to your computer and use it in GitHub Desktop.
Save thangngoc89/5cb6ed437584885aa6bcf44719cc59e9 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: 'nit',
initial: 'idle',
context: {
retries: 0
},
states: {
idle: {
on: {
INPUT_UPDATE: 'compiling'
}
},
compiling: {
on: {
COMPILE_ERROR: 'compile_error',
COMPILE_SUCCESS: 'evaling'
}
},
compile_error: {
on: {
INPUT_UPDATE: 'compiling'
}
},
evaling: {
on: {
EVAL_SUCCESS: 'idle',
EVAL_ERROR: 'eval_error'
}
},
eval_error: {
on: {
INPUT_UPDATE: 'compiling'
}
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment