W3C home > Mailing lists > Public > www-dom@w3.org > October to December 2012

Re: Adding `detail` to Event

From: Marcos Caceres <w3c@marcosc.com>
Date: Wed, 28 Nov 2012 11:14:36 +0000
To: olli@pettay.fi
Cc: David Håsäther <hasather@gmail.com>, www-dom@w3.org
Message-ID: <9E7A3E42E0D14F679A036A07E10C8E85@marcosc.com>



On Wednesday, November 28, 2012 at 11:04 AM, Olli Pettay wrote:

> On 11/28/2012 12:30 PM, David Håsäther wrote:
> > The only reason for CustomEvent is to be able to pass a `detail`
> > object. It seems unnecessary to have a separate constructor just to be
> > able to pass an extra object, and I would suggest that Event could
> > take `detail` too (thereby deprecating CustomEvent).
> >  
> > I asked Anne on IRC if it's too late to add `detail` to Event and he
> > said "no at all".
> >  
> > --
> > David Håsäther
>  
>  
>  
>  
> What is the use case for having .detail in Event?
>  


The use case is being able to pass custom data as part of a custom event - this is really useful for all sorts of things as the data pertains to whatever emitted the event (e.g., a parser could tell your how many things it parsed, if anything was discarded, how long it took, etc.).   

--  
Marcos Caceres
Received on Wednesday, 28 November 2012 11:15:04 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 28 November 2012 11:15:06 GMT