yanickrochon/promise-events

Type definition of `. once(type, listener)` should have listener as optional parameter

abdatta opened this issue ยท 3 comments

In the type definition, we see:

once(type: TEventType, listener: TListener): Promise<any>;

It should be instead:

once(type: TEventType, listener?: TListener): Promise<any>;

since the listener parameter is optional as per documentation:

emitter.once(eventName)

Returns a Promise that is resolved once only after all listeners for the specified event have been called for the given event. (Any newListener event will be emitted.)

@yanickrochon Let me know if you agree. I'll raise a PR for the same.

Sounds about right! I do not use TS, personally, so all these PR are for the community ๐Ÿ˜„

Can you merge #23 then? Thank you ๐Ÿ™‚

Sorry, it's published!