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

Re: Better event listeners

From: Mounir Lamouri <mounir@lamouri.fr>
Date: Wed, 27 Mar 2013 17:54:54 +0000
Message-ID: <5153326E.8030706@lamouri.fr>
To: www-dom@w3.org
On 16/03/13 14:20, brandon.wallace@yahoo.com wrote:
> As an author, I very rarely need to subscribe to a single occurrence of an event.  The vastly more common case is to subscribe to a stream of events until some condition is met, then unsubscribe from the stream.
> 
> Since a future represents a single occurrence of an event, it can really only be used in the rare case, but not in the common multi-occurrence case.  But then I would have to choose to use a different API (Futures) for this rare case.  Why would I do that, when I could instead use the common streaming API and just unsubscribe when the event occurs?

I agree with Brandon, given that Future can only apply with something
like .once(), I doubt it is really useful to try to include Future here
because part of the API would be using the traditional callbacks and
another part would be using Future. The inconsistency doesn't seem to be
worth it.

--
Mounir
Received on Wednesday, 27 March 2013 17:55:21 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 27 March 2013 17:55:31 UTC