Better way to maintain this reference on event listener functions

Andrea Giammarchi andrea.giammarchi at
Mon May 9 16:46:25 UTC 2016

Oh well, if removing after first click is the use-case,
this.onClick, {once: true})` is already in the standard pipeline (and
polyfilled in dom4)

Best Regards

On Mon, May 9, 2016 at 5:41 PM, Boris Zbarsky <bzbarsky at> wrote:

> On 5/9/16 12:37 PM, Mark Kennedy wrote:
>> and also REMOVING the event listeners manually.
> I think this is the key part.  What is the precise use case for removing
> here?  I think that affects how this would best be designed.
> The obvious case is when you want to remove the listener at the point when
> it fires.  This would be most easily addressed by providing a way to get at
> the listener from inside itself somehow.  Are there other uses?
> -Boris
> _______________________________________________
> es-discuss mailing list
> es-discuss at
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list