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

Re: Better event listeners

From: James Graham <jgraham@opera.com>
Date: Fri, 11 Jan 2013 13:53:12 +0100
Message-ID: <50F00B38.20407@opera.com>
To: www-dom@w3.org
On 01/10/2013 08:06 PM, Jake Verbaten wrote:
> Putting properties on a function is valid. There's plenty of room for
> future enhancements.

It's valid but ugly as hell.

I don't see why we want to artificially paint ourselves into a corner here.

is
var evt = elem.on("click", function() {}, "button");
[...]
evt.detach();

so much worse than

var detach = elem.on("click", function() {}, "button");
[...]
detach();

That we are prepared to risk future headaches because we didn't allow 
for the possibility of future additions to this part of the platform?
Received on Friday, 11 January 2013 12:53:42 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 11 January 2013 12:53:44 GMT