Created
September 21, 2021 02:54
-
-
Save datdoan/1e8ce1d3adb9874233ac3b81bd635a62 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
This file contains hidden or 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 rotationMachine = Machine({ | |
| id: 'rotate', | |
| initial: 'autoplay', | |
| states: { | |
| autoplay: { | |
| on: { | |
| TRUE: 'play', | |
| FALSE: 'pause', | |
| }, | |
| }, | |
| play: { | |
| on: { | |
| IS_STOPPED: 'pause', | |
| HAS_HOVER: 'pause', | |
| HAS_FOCUS: 'pause', | |
| }, | |
| }, | |
| pause: { | |
| on: { | |
| IS_NOT_STOPPED: 'play', | |
| HAS_NOT_NOT_HOVER: 'play', | |
| HAS_NOT_FOCUS: 'play', | |
| }, | |
| } | |
| } | |
| }); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment