Exactly, there are two separate issues and the core topic of this post is to avoid any unnecessary…
Viraj Tank
11
Hot observables are to be used when multiple views are using the same observable for getting a more common information regardless of the previous information emitted by it
Not “only” for that, also when you don’t want the underlying action to be influenced by the act of un/subscribing, which is the case here.
Are you advising to convert all Observables to “hot” observables? it is not a good practice.
For this use case, why not? You should always think of your app as a “model” layer and a “presentation” layer. Something like making a network call (one that impacts the entire app) should be made in the model layer, so that if the presentation layer changes, the call still goes on, unaffected by the lifecycle of external components.