Created
September 29, 2021 04:43
-
-
Save itacirgabral/2ea77cf325a5acec3ffe02c6bb11e1e7 to your computer and use it in GitHub Desktop.
Revisions
-
itacirgabral created this gist
Sep 29, 2021 .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,34 @@ const machine = Machine({ id: 'lightbulb', initial: 'unlit', states: { lit: { on: { TOGGLE: 'unlit', BREAK: 'broken' } }, unlit: { exit: () => {}, on: { TOGGLE: 'lit', BREAK: { target: 'broken', actions: [(ctx, e) => { console.log(e.myArg) }, 'logB'] } } }, broken: { type: 'final', entry: (ctx, e) => {} // ['a', 'b'] } }, strict: true }, { actions: { logB: () => console.log('b') }, })