Created
December 25, 2019 09:55
-
-
Save zetavg/6d143661b983445a7fa4a74c004c49d3 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
const appMachine = Machine({ | |
id: 'app', | |
initial: 'unauthenticated', | |
states: { | |
unauthenticated: { | |
on: { | |
LOGIN: 'authenticated', | |
}, | |
}, | |
authenticated: { | |
on: { | |
LOGOUT: { | |
target: 'unauthenticated', | |
}, | |
}, | |
type: 'parallel', | |
states: { | |
playback: { | |
initial: 'stopped', | |
states: { | |
playing: { | |
on: { | |
PAUSE: 'paused', | |
STOP: 'stopped', | |
}, | |
}, | |
paused: { | |
on: { | |
PLAY: 'playing', | |
STOP: 'stopped', | |
}, | |
}, | |
stopped: { | |
on: { | |
PLAY: 'playing', | |
}, | |
}, | |
}, | |
}, | |
repeat: { | |
initial: 'off', | |
states: { | |
off: { | |
on: { | |
TOGGLE_REPEAT_MODE: 'all', | |
}, | |
}, | |
all: { | |
on: { | |
TOGGLE_REPEAT_MODE: 'one', | |
}, | |
}, | |
one: { | |
on: { | |
TOGGLE_REPEAT_MODE: 'off', | |
}, | |
}, | |
} | |
} | |
}, | |
}, | |
}, | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment