Re: [whatwg/dom] Consider adding Promise-based API for listerning event (#333)

You don't actually need to allocate a promise for every mouse click - and note that allocating a promise is cheaper than an empty array at this point so unless you have hundreds of thousands of mouse clicks and handling of concurrently it's not a huge issue. 

However, I think observables are a nicer fit conceptually since they're push streams and model clicks much more naturally. Even if you'd use async iterators you'd bastardize them to act like observables in this case though a function that consumes from the iterators as elements enter the iteration. With observables it's just subscribe.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/issues/333#issuecomment-253678642

Received on Friday, 14 October 2016 00:35:17 UTC