3 ms·
Promises aren't going anywhere. async/await is built on top of Promises, for instance. Observables are in position to be adopted by ECMAScript in a future spec
by WorldMaker 9y ago
Promises aren't going anywhere. async/await is built on top of Promises, for instance.
Observables are in position to be adopted by ECMAScript in a future spec eventually, but they are still only at Stage 1 of the ES proposal process, and also Observables don't exactly replace Promises so much as extend them.
An Observable can be thought of as a "stream" of promised values rather than just a single promised value. It's a somewhat different paradigm. From the Observable perspective a Promise is a simple Observable that produces a single value and completes immediately after. So you can see Promises are useful in an Observable world as something of a building block.
A good resource on Observables can be: http://reactivex.io/ http://reactivex.io/
It's focused on the main cross-platform library for Observables (ReactiveX which has implementations in .NET, Java, JS, more), but a lot of it is applicable to Observables in general and it has a lot of good "marble" diagrams that can help show why Observables can be powerful.
The dry Stage 1 ES spec itself is here: https://github.com/tc39/proposal-observable https://github.com/tc39/proposal-observable