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

@mathiasbynens I'm aware of that, and I remember some discussions in the V8 team whether or not it makes sense to have Observables as primitives, similar to Promises.

I'm not speaking as a V8 representative or some TC39 implementor here. Just my own personal opinion:

When we say that Observables are perfectly fine as a user land feature and have a single, canonical implementation of that primitive, i.e. RxJS, that makes total sense to me. However adding Observables as primitives to the platform via some embedder API (be it something in the browser or something in node, or both in the end) doesn't seem like it's the best approach long-term, as you might end up with a lot of copy and paste, and due to performance constraints you'll probably want to have the core part implemented inside the JavaScript engine eventually, which is not covered by the TC39 specification then.

So my question is really: If we think it is useful as a native platform feature, shouldn't the primitive then end up in ECMAScript, and have platform APIs (node/browser) define more complex logic in terms of the primitive? Like we did with Promises? What makes Observables as a primitive different from Promises in this regard?

-- 
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-352499976

Received on Monday, 18 December 2017 17:40:30 UTC