Skip to content

Instantly share code, notes, and snippets.

@jcmorrow
Last active November 18, 2022 17:46
Show Gist options
  • Save jcmorrow/9668f59cb26c0a06925b3c4002b181da to your computer and use it in GitHub Desktop.
Save jcmorrow/9668f59cb26c0a06925b3c4002b181da 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 streamFromNetworkToDiskAndListeners = Machine({
id: 'streamToDiskAndListeners',
initial: 'idle',
context: {
listeners: []
},
states: {
idle: {
on: {
STREAM: 'streaming'
}
},
streaming: {
on: {
DONE: 'closed',
ERROR: 'failed',
CHUNK: {
actions: () => {
}
}
}
},
closed: {
type: 'final'
},
failed: {
type: 'final'
},
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment