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

@othermaciej The primary difference would be that ReadableStream, AsyncIterator, et al, are pull-based, where Promise and Observable are push-based. Certainly ReadableStream and AsyncIterator would fall into that generic quadrant, but it doesn't mean they can be used in the same way. I'd almost argue that Promise misses the mark in the "temporal" space, because it isn't able to act synchronously, only asynchronously, therefor not all timings could work with it as a primitive. Observables, on the other hand, are much more primitive and do not prescribe any scheduling for values emissions. ReadableStream and AsyncIterator are implemented on top of promise, meaning that they're also tied to the same scheduling restrictions. Restrictions that make them not viable as an abstraction for eventing, as events can be subscribed to, dispatched and torn down synchronously.

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

Received on Monday, 18 December 2017 18:06:50 UTC