TypeScript Tested
Type-safe event emitter
An event emitter whose event names and payloads are checked by the compiler through a generic map type.
Loading snippets…
2 snippets
An event emitter whose event names and payloads are checked by the compiler through a generic map type.
Publish and subscribe to named events in about 15 lines, with an unsubscribe function returned from on().