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
| // Usage | |
| const foo = signal(); | |
| // subscribe (callback must return a nullish value) | |
| foo(() => console.log("subscriber #1")); | |
| foo(() => console.log("subscriber #2")); | |
| // fire and reset | |
| foo(); // subscriber #1, subscriber #2 | |
| foo(); // nothing |