-
-
Notifications
You must be signed in to change notification settings - Fork 643
Open
Labels
Description
Type description + examples
We would like to have a way to add generics to EventTarget.
const emitter = EventTarget<{
a: void;
b: number[];
}>();means a event with no payload, and b event with number[] payload.
Maybe should actually provide Event object instead as values.
Type source
https://github.com/Richienb/strict-event-target/tree/main
I think it should be some interface extends EventTarget, and we override add/remove - EventListener
TypeScript issue: microsoft/TypeScript#43477
Search existing types and issues first
- I tried my best to look for it