-
Notifications
You must be signed in to change notification settings - Fork 81
Open
Labels
Type: FeatureNew feature or requestNew feature or requesttypescriptRelevant to TypeScript users onlyRelevant to TypeScript users only
Description
What’s missing?
Methods like .on
and .removeListener
use event: E | E[]
, it would be nice to change it to event: E | readonly E[]
, since it's convenient to have an as const
list of event names (which currently get a type error when passing it to an E[]
argument).
Why?
Makes TS code better.
Alternatives you tried
const eventNames = [ ... ] as const;
const eventNamesSillyCopy = eventNames.slice(0);
Metadata
Metadata
Assignees
Labels
Type: FeatureNew feature or requestNew feature or requesttypescriptRelevant to TypeScript users onlyRelevant to TypeScript users only