You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Mostly because it’s often useful, I assume – it means you don’t have to store the object in another way, and often you can avoid having a closure this way.
It is not compatible with browser.
Node’s EventEmitter API doesn’t match the browser’s EventTarget API in a number of ways – that’s unfortunate, but it’s not something we could reasonably change easily.
I’d say there’s a chance that EventTarget could be introduced into Node as it adopts more and more Browser APIs, but too much code relies on how the current EventEmitter API works for us to make changes to that.
I’d say there’s a chance that EventTarget could be introduced into Node
Would really like to see EventEmitter etc being implemented in node too so that ppl building cross browser/platform works the same way without any additional dependencies
node/lib/events.js
Line 198 in 2f9c9ee
Why do you bind ”this“ here?It is not compatible with browser.