Be clear on hot and cold observables

Being aware of the type of each observable is of key importance. By default, observables in ReactiveX are cold. Following this convention will avoid surprises for people reading the code. Making cold observables hot only on purpose makes it obvious when reading the code. However, there are cases where an observable has to be implemented as a hot one. In such cases, make this information clear in the documentation of the observable factory.

Misusing a cold observable as a hot observable provokes the opposite effect from the "nothing happens" symptom: actions are executed multiple times instead of only once. This is also usually easy to detect, but finding the root cause can once again be more tricky. The dichotomy search with a trace observer is also valid in this case to find the root cause of the issue.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.217.147.193