Re: [whatwg/dom] Improving ergonomics of events with Observable (#544)

Concur with @domenic. There are unquestionably impedance mismatches between EventTarget/Observables and Promises due to the way each schedules notifications respectively. However there are plenty of simple use cases in which adapting ET/Observable to Promises is convenient and safe, and we should enable those. I think the best course of action is to provide methods to allow developers to handle ET concerns prior to adaptation (ie the do method).

Sent from my iPhone

> On Dec 14, 2017, at 8:46 AM, Domenic Denicola <notifications@github.com> wrote:
> 
> Just to reiterate, I don't expect the primary way for people to use observables to subscribe to events to be promises. That is only when you want to convert into a promise-using ecosystem (e.g. service worker's waitUntil). Most of the time you'll just do e.g. element.on("click").subscribe(e => e.preventDefault()).
> 
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub, or mute the thread.
> 


-- 
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/544#issuecomment-351777056

Received on Thursday, 14 December 2017 17:16:12 UTC