Created
February 4, 2021 15:12
-
-
Save DogPawHat/534fbb62ceb7f02907cc5abfa1f65e37 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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