fix: fluent interface for EventEmitter#475
Conversation
| const zoneAwareAddListener = makeZoneAwareAddListener(EE_ADD_LISTENER, EE_REMOVE_LISTENER, false, true); | ||
| const zoneAwarePrependListener = makeZoneAwareAddListener(EE_PREPEND_LISTENER, EE_REMOVE_LISTENER, false, true); | ||
| const zoneAwareRemoveListener = makeZoneAwareRemoveListener(EE_REMOVE_LISTENER, false); | ||
| const zoneAwareAddListener = makeZoneAwareAddListener(EE_ADD_LISTENER, EE_REMOVE_LISTENER, false, true, true); |
There was a problem hiding this comment.
IMO adding a "magic" boolean param is not the best way to to this.
Can you add makeChainable... that wraps the underlying method and return self ?
There was a problem hiding this comment.
Sure, let me know what you think now!
3c04170 to
292558f
Compare
| return delegate; | ||
| } | ||
|
|
||
| export function makeNamedFnChainable(fn: (self: any, args: any[]) => any) { |
There was a problem hiding this comment.
- pls move this fn where it is used (ie
events.ts). - use arrow fn,
- wouldn't
callAndReturnFirstParam(...)be more explicit ?
There was a problem hiding this comment.
I would prefer named functions, because stack trace when debugging, but I've got nothing against good policies!
|
angular/universal#568 |
|
@vicb, @JakubMal ?? I waiting for this P.R, because wallabyjs/public#814 |
|
Sorry, I was short on time lately, I should be able get this ready this week!
|
292558f to
f65630b
Compare
|
All issues addressed! :) |
|
@alxhub ? |
|
I'm hoping this PR will fix my |
|
@spenoir, yes this has been released. |
Fixes #470 by returning self from
addListener,on,prependListener,removeListenerin Node.js.