RxJava - When and why to use Observable.share()
I've seen patters like this: Observable<String> nameChanges = nameDataSource.changes().share(); // One subscriber autoUnsubscribe(nameChanges.subscribe(() -> { ... })); // Another subscriber autoUnsubscribe(nameChanges.map(...).filter(...).subscribe(...)); // autoUnsubscribe is called when the UI is torn down My question is: Why is it necessary to call share() whenever I want to listen to the Observable in multiple places? Why is not share() the default behavior for all observables? It would be nice if the code above worked the same even without .share() . I would not have to think about when