Question - What is the difference between RxJS Observables and Promises?
Answer -
Following is the list of main differences between RxJS Observables and Promises:
RxJS Observables | Promises |
Observables are used to run asynchronously, and we get the return value multiple times. | Promises are used to run asynchronously, and we get the return value only once. |
Observables are lazy. | Promises are not lazy. |
Observables can be canceled. | Promises cannot be canceled. |
Observables provide multiple future values. | Promises provide a single future value. |