Created
May 19, 2020 13:35
-
-
Save MaelFr/8a72e9d2ebef81cb26fe69b51cffac84 to your computer and use it in GitHub Desktop.
Revisions
-
MaelFr created this gist
May 19, 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,27 @@ const door = Machine({ id: 'door', initial: 'locked', states: { locked: { on: { UNLOCK: 'unlocked' } }, unlocked: { initial: 'closed', states: { closed: { on: { LOCK: '#door.locked', OPEN: 'opened' } }, opened: { on: { CLOSE: 'closed' } } } } } })