Created
October 4, 2019 20:26
-
-
Save tiagonevestia/e1a4130d849885bca206ea9a8eaff588 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 videoMachine = Machine({ | |
id: 'videoMachine', | |
initial: 'loading', | |
states: { | |
loading:{ | |
on: { | |
LOADED: 'ready', | |
FAIL: 'failure' | |
} | |
}, | |
ready:{ | |
initial: 'paused', | |
states:{ | |
paused: { | |
on: { | |
PLAY: 'playing' | |
} | |
}, | |
playing: { | |
on:{ | |
PAUSE: 'paused', | |
END: 'ended', | |
TIMING: 'playing' | |
} | |
}, | |
ended: { | |
on: { | |
PLAY: 'playing' | |
} | |
} | |
} | |
}, | |
failure: { | |
type: 'final' | |
} | |
} | |
}) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment