Typescript tips - How to declare a type for an event dispatcher?

preview_player
Показать описание
The video shows how to declare a fully typed event dispatcher using Typescript, starting with a basic implementation and ending with a fully typed version.

The solution allows to avoid:
* Listen/dispatch events that don't exist
* Listen to an event using a callback that expect wrong arguments to be passed to it
* Dispatch an event passing wrong arguments
Рекомендации по теме
visit shbcf.ru