Created
December 20, 2019 03:24
-
-
Save tgrecojs/59e91956a66f516adb90e8eb9e361633 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 fetchMachine = Machine({ | |
| id: 'lightswitch', | |
| initial: 'off', | |
| states : { | |
| turned_off: { | |
| on: { | |
| BREAK: 'off', | |
| toggle: 'on' | |
| }, | |
| }, | |
| turned_on: { | |
| on: { | |
| BREAK: 'off', | |
| toggle: 'off' | |
| }, | |
| } | |
| } | |
| }) | |
| const fetchMachineTwo = Machine({ | |
| id: 'lightswitch', | |
| initial: 'off', | |
| states : { | |
| turned_off: { | |
| on: { | |
| BREAK: 'off', | |
| toggle: 'on' | |
| }, | |
| }, | |
| turned_on: { | |
| on: { | |
| BREAK: 'off', | |
| toggle: 'off' | |
| }, | |
| } | |
| } | |
| }); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment