W3C home > Mailing lists > Public > www-dom@w3.org > January to March 2013

Re: Better event listeners

From: Marcos Caceres <ecmascript@marcosc.com>
Date: Mon, 7 Jan 2013 21:50:18 +0000
To: Rick Waldron <waldron.rick@gmail.com>
Cc: Fran├žois REMY <francois.remy.dev@outlook.com>, DOM WG <www-dom@w3.org>, es-discuss <es-discuss@mozilla.org>
Message-ID: <1D39BFF5D50C438F95C0C71ADE358B32@marcosc.com>

On Monday, 7 January 2013 at 19:15, Rick Waldron wrote:

> I wonder if this is the moment where redemption can happen... Instead of trying to invent some kind of new approach, why not standardize on the massive, 16 lane, mega-highway cow-path just waiting to be paved: 
> on => addEventListener
> off => removeEventListener
> emit => dispatchEvent
> I'd suggest Node's EventEmitter (and EventEmitter2) as a reasonable starting point for an ideal, "subclassable" EventTarget-like system. 

The above are great options, but I'd cry tears of joy for just having a constructor on EventTarget. I guess if we can fix a whole bunch of issues in one go (...man, that leveraging selectors for choosing targets is so nice...), that would be great, but I'm worried about getting bogged down. 

Marcos Caceres
Received on Monday, 7 January 2013 22:53:27 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 20 October 2015 10:46:20 UTC