• Home
  • Recent Q&A
  • Java
  • Cloud
  • JavaScript
  • Python
  • SQL
  • PHP
  • HTML
  • C++
  • Data Science
  • DBMS
  • Devops
  • Hadoop
  • Machine Learning
in Angular by
Q:
Differentiate between Observables and Promises.

1 Answer

0 votes
by

Observables are lazy, which means nothing happens until a subscription is made. Whereas Promises are eager; which means as soon as a promise is created, the execution takes place. Observable is a stream in which passing of zero or more events is possible and the callback is called for each event. Whereas, promise handles a single event. 

Related questions

+1 vote
asked Jan 15, 2020 in Angular by rahuljain1
+1 vote
asked Jan 15, 2020 in Angular by rahuljain1
...