There is a discussion on stackoverflow: what is the difference between problems and observables?
A useful blog: angular2 observables, HTTP, and separating services and components
An article on the official website of angular: observables compared to other technologies
The difference between observable and promise:
Observables are declarative; computation does not start until subscription. Promises execute immediately on creation. This makes observables useful for defining recipes that can be run whenever you need the result.
Observable is declarative, and calculation is not triggered until subscription. This is very different from promise — promise is executed immediately after it is created.
Observables provide many values. Promises provide one. This makes observables useful for getting multiple values over time.
Observable provides multiple values, while promises can only provide a single value.
Observables differentiate between chaining and subscription. Promises only have .then() clauses. This makes observables useful for creating complex transformation recipes to be used by other part of the system, without causing the work to be executed.
Observable can be combined into complex transformation recipes with the help of rich operators in rxjs, which is convenient for reuse in application, while promise has only one then operation.
Observables subscribe() is responsible for handling errors. Promises push errors to the child promises. This makes observables useful for centralized and predictable error handling.
Read More:
- [math processing error] problem solving (the difference between F5 refresh page and Ctrl / shift + F5 refresh page)
- The difference between onready or $() and onload
- C#: Analysis of the difference between write() and writeline()
- The difference between LSTM and Gru
- The difference between classnotfoundexception and NoClassDefFoundError
- Difference between getelementsbyname and getelementbyid
- The difference and usage of insmod and modprobe
- The difference between hive and relational database
- Difference between vs code user and system version
- The difference between sleep() and wait() in Java
- Parsing the difference between “R” and “RB” patterns of text files (Python)
- The difference of. Pt,. PTH,. Pkl and the way to save the model
- The difference between “?” and “?:” introduced by php7
- JavaScript summary: the difference between typeof and instanceof, and Object.prototype.toString() method
- The usage and difference of atoi() and stoi() functions in C + +
- The tutorial and difference of glew, glfw, glad and freeglut
- Node.js Medium package.json The difference between devdependences and dependencies
- The difference of four kinds of integer function (fix floor ceil round) in MATLAB
- Difference between routermodule.forroot and routermodule.forchild
- Python json.dumps () json.dump The difference between ()