Proposal to add EventEmitter to core [ES7]
aakarsh1997
aakarsh1997 at gmail.com
Sun May 31 16:46:48 UTC 2015
Hi,
I propose the inclusion of the node/io EventEmitter class[1] in core
targeting ES7.
Reasoning:
The .on/.emit model is very popular[2] in the ECMAScript land, and it suits
the language a lot. We use events pretty much everywhere in the JS land.
It makes sense for the standard EventEmitter class used commonly to be
included in core. With ES6 classes, userland code classes extending[3] the
EventEmitter class would be pretty common and useful even in environments
like browsers.
Notes:
I think the `.once` method from the node/io EventEmitter class _could_ be
left out from standard implementation mainly because we would rather use
Promises there. Although it would also make sense to keep it in for further
compatibility.
[1] https://iojs.org/api/events.html
[2]
https://github.com/search?l=JavaScript&q=eventemitter&ref=opensearch&type=Code
[3]
https://github.com/search?p=2&q=extends+eventemitter&ref=searchresults&type=Code&utf8=%E2%9C%93
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20150531/e954c1e2/attachment.html>
More information about the es-discuss
mailing list