I have been attempting to implement the following code:
addEventListener(...args: Parameters<EventEmitter>) {
this.on(args);
}
Unfortunately, it is not functioning as expected.
The initial error related to
...args: Parameters<EventEmitter>
states that Rest parameter 'args' implicitly has an 'any[]' type.
As for the second error concerning this.on(args)
, it reads
Expected 2-3 arguments, but got 1.
I am aware that this.on
represents an EventEmitter
and I wish to rename it so that I can utilize this.addEventListener
on my specific instance.