Skip to content

Instantly share code, notes, and snippets.

@saneef
Last active October 23, 2020 17:20
Show Gist options
  • Save saneef/a6434291a9d63ff954020765e81d8b47 to your computer and use it in GitHub Desktop.
Save saneef/a6434291a9d63ff954020765e81d8b47 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: 'idle',
context: {
elapsed: 0,
},
on: {
RESET: { target: 'idle', actions: 'resetElasped' }
},
states: {
idle: {
on: {
START: 'running',
}
},
running: {
on: {
STOP: 'idle'
}
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment