Sanwar Ranwa
What is difference in observables and Promises?
By Sanwar Ranwa in Angular on Jan 18 2019
  • Pranam Bhat
    May, 2021 28

    Observables : Are lazy: they're not executed until we subscribe to them using the subscribe() method.Promise : Are not lazy: execute immediately after creation.Promise is eager, whereas the Observable is lazy.Promise is always asynchronous, while the Observable can be either asynchronous or synchronous.Promise can provide a single value, whereas the Observable is a stream of values (from 0 to multiple values).We can apply RxJS operators to the Observable to get a new tailored stream.

    • 1


Most Popular Job Functions


MOST LIKED QUESTIONS