Skip to content

Instantly share code, notes, and snippets.

@agenthunt
Last active April 8, 2020 10:35
Show Gist options
  • Save agenthunt/9545f87bd9071302bb2afd756cd18e4a to your computer and use it in GitHub Desktop.
Save agenthunt/9545f87bd9071302bb2afd756cd18e4a 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 connectionStatusMachine = Machine({
id: 'connectionStatus',
initial: 'DISCONNECTED',
context: {
retries: 0
},
states: {
DISCONNECTED: {
on: {
CONNECT: 'CONNECTED'
}
},
CONNECTED: {
on: {
PAUSE: "PAUSED",
DISCONNECT: "DISCONNECTED"
}
},
PAUSED: {
on: {
RESUME: "CONNECTED"
}
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment