TypeScript 50 🔷 Type-Safe Event Emitters
An event emitter is a publish-subscribe mechanism: one part of a system announces that something happened, and other parts subscribe to be notified. Node.js has EventEmitter. The browser has addEventListener and CustomEvent. Angular has EventEmitter and signals. Every framework has some version of the pattern. The untyped versions share the same weakness: the event name…