Open
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);