-
-
Save spac3unit/c2cc231ea36cb5d67b15e41e32538e74 to your computer and use it in GitHub Desktop.
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
| const d = createDomain(); | |
| d.onCreateStore((s) => { | |
| s.updates.watch((value) => { | |
| console.log(`STORE ${s.shortName} UPDATED`, value); | |
| }); | |
| }); | |
| d.onCreateEvent((e) => { | |
| e.watch((params) => { | |
| console.log(`EVENT ${e.shortName} TRIGGERED`, params); | |
| }); | |
| }); | |
| d.onCreateEffect((e) => { | |
| e.watch((params) => { | |
| console.log(`EFFECT ${e.shortName} TRIGGERED`, params); | |
| }); | |
| e.done.watch((params) => { | |
| console.log(`EFFECT ${e.shortName} DONE`, params); | |
| }); | |
| e.fail.watch((params) => { | |
| console.log(`EFFECT ${e.shortName} FAIL`, params); | |
| }); | |
| }); | |
| const { createStore, createEvent, createEffect } = d; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment