TypeScript: Building a better EventEmitter
Tech Talks with Simon
0:00 / 0:00
TypeScript: Building a better EventEmitter
13 403 просмотра · 3 года назад
Tech Talks with Simon
2,27 тыс. подписчиков
13 403 просмотра · 3 года назад
The built-in types for EventEmitter are totally broken. I'll show you how to build a 100% type-safe EventEmitter in TypeScript and it's not as hard as it sounds.
This should be easy enough to follow if you're comfortable with intermediate TypeScript, specifically Generics and Mapped Types (link to docs below).
Let me know if you're into this kind of TypeScript content because I've got a few other good ones in the pipeline.
Learn more:
Generic Constraints: https://www.typescriptlang.org/docs/h...
Mapped Types: https://www.typescriptlang.org/docs/h...