Skip to content

Instantly share code, notes, and snippets.

@bryanjswift
Last active June 18, 2021 15:51
Show Gist options
  • Save bryanjswift/0f7739272d125a02da4c67d2d47afea5 to your computer and use it in GitHub Desktop.
Save bryanjswift/0f7739272d125a02da4c67d2d47afea5 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 eventStatusMachine = Machine({
id: 'show',
initial: 'UNDER_CONSTRUCTION',
states: {
UNDER_CONSTRUCTION: {
on: {
TEASER: 'TEASER',
},
},
TEASER: {
on: {
UNDER_CONSTRUCTION: 'UNDER_CONSTRUCTION',
PRE_SHOW: 'PRE_SHOW',
},
},
PRE_SHOW: {
on: {
TEASER: 'TEASER',
DOORS_OPEN: 'DOORS_OPEN',
},
},
DOORS_OPEN: {
on: {
PRE_SHOW: 'PRE_SHOW',
PLAYBACK_START: 'PLAYING',
},
},
PLAYING: {
on: {
PLAYBACK_END: 'PRE_AFTERPARTY',
PLAYBACK_PAUSE: 'PAUSED',
},
},
PAUSED: {
on: {
PLAYBACK_RESUME: 'PLAYING',
PLAYBACK_END: 'PRE_AFTERPARTY',
},
},
PRE_AFTERPARTY: {
on: {
PLAYBACK_START: 'PLAYING',
AFTERPARTY: 'AFTERPARTY',
},
},
AFTERPARTY: {
on: {
PRE_AFTERPARTY: 'PRE_AFTERPARTY',
HANGOVER: 'HANGOVER',
},
},
HANGOVER: {
on: {
AFTERPARTY: 'AFTERPARTY',
DOORS_CLOSE: 'DOORS_CLOSE',
},
},
DOORS_CLOSE: {
on: {
HANGOVER: 'HANGOVER',
POST_SHOW: 'POST_SHOW',
},
},
POST_SHOW: {
type: 'final',
},
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment