Unless target platform isn't NodeJS, creating custom class with custom implementation just to get type-checking is probably overkill.
Current implementation:
is limited, since by design it allows only one event per emitter.
supports only 1 passed argument to emit and listener.
might introduce bugs because of custom implementation like it did before: #405, #516.
Wouldn't it be better if we simply define custom typings for the existing EventEmitter implementation and export it? Wrote small library that does just that.
Unless target platform isn't NodeJS, creating custom class with custom implementation just to get type-checking is probably overkill.
Current implementation:
emit
andlistener
.Wouldn't it be better if we simply define custom typings for the existing EventEmitter implementation and export it? Wrote small library that does just that.
Sample: