In this article, we will see What is the Difference Between Promises and Observables.
What is Promise?
This indicates that all current browsers natively support this functionality without the need for an external library or plugin.
What is Observable?
Single VS Multi Values
A promise can emit a single value over a period of time.
An Observable can emit multiple values over a period of time.
Lazy VS Non-Lazy
A Promise is not lazy in nature. A promise will be executed even if there is no then statement chained to that promise.
An Observable is lazy in nature, it won't run until there is a subscription for that observable.
If there is no subscription for an observable, the observable will not run.
Cancel VS Non-Cancel
A promise is not cancellable by default
An Observable can be cacellable, we can cancel an obserable any time by calling the unsubscibe method.
A Promise has chaining methods as then(), catch() or finally()
An Obserbale has the option of chaiing with many functions like subscibe, map, filter, reduce,forEach, etc...