Skip to content

Instantly share code, notes, and snippets.

@DogPawHat
Created February 4, 2021 15:12
Show Gist options
  • Save DogPawHat/534fbb62ceb7f02907cc5abfa1f65e37 to your computer and use it in GitHub Desktop.
Save DogPawHat/534fbb62ceb7f02907cc5abfa1f65e37 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 backstageStates = {
initial: 'offline',
states: {
offline: {
on: {
PLAY_CONTENT: 'content',
},
},
content: {
on: {
END_STREAM: 'offline',
},
}
}
};
const roomMachine = Machine({
id: 'room',
initial: 'backstage',
states: {
backstage: {
on: {
GO_LIVE: 'live',
},
...backstageStates,
},
live: {
on: {
END_STREAM: 'backstage',
}
},
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment