What are the differences between promises and observables

Posted by Jessica Taylor | Updated on

Some of the major difference in a tabular form:

PromisesObservables
Emits only a single value at a timeEmits multiple values over a period of time(stream of values ranging from 0 to multiple)
Eager in nature; they are going to be called immediatelyLazy in nature; they require subscription to be invoked
Promise is always asynchronous even though it resolved immediatelyObservable can be either synchronous or asynchronous
Doesn’t provide any operatorsProvides operators such as map, forEach, filter, reduce, retry, and retryWhen etc
Cannot be canceledCanceled by using unsubscribe() method

If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers