Created
September 7, 2020 00:54
-
-
Save datdoan/1b7e547726310d996a72c748ad00eaf2 to your computer and use it in GitHub Desktop.
Revisions
-
datdoan created this gist
Sep 7, 2020 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,41 @@ // Available variables: // - Machine // - interpret // - assign // - send // - sendParent // - spawn // - raise // - actions // - XState (all XState exports) const statusMachine = Machine({ id: 'status', type: 'parallel', states: { closed: { initial: 'on', states: { on: { on: { TOGGLE_CLOSED: 'off' } }, off: { on: { TOGGLE_CLOSED: 'on' } } } }, open: { initial: 'on', states: { on: { on: { TOGGLE_OPEN: 'off' } }, off: { on: { TOGGLE_OPEN: 'on' } } } }, } });