The original reason is that it allowed chaining (e.g. obs.subscribe(someObserver).subscribe(someOtherObserver)) with a tweak. The subscription of an observer on a subscription would end if either the subscribed observable ended, or if the subscription the observer was added to was terminated. So for instance...
In the above example, calling unsubscribe on the subscription will not only prevent observer1 from getting any more events from the observable, but will also cause the onCompleted method on observer2 to be called and that observer will no longer receive any events from the observable.
I think I may have had specific plans for this functionality at one time, and I think it was linked to collections; but I must have changed the implementation to not use that. I don't think this feature is used anywhere, but I'm not sure. Basically, this feature provides the ability to create an observable that reflects another observable's events 1:1 until a subscription is called. Perhaps this ability is not very useful, or perhaps it could be accomplished in a more clear way.
The original reason is that it allowed chaining (e.g.
obs.subscribe(someObserver).subscribe(someOtherObserver)
) with a tweak. The subscription of an observer on a subscription would end if either the subscribed observable ended, or if the subscription the observer was added to was terminated. So for instance...In the above example, calling unsubscribe on the subscription will not only prevent observer1 from getting any more events from the observable, but will also cause the onCompleted method on observer2 to be called and that observer will no longer receive any events from the observable.
I think I may have had specific plans for this functionality at one time, and I think it was linked to collections; but I must have changed the implementation to not use that. I don't think this feature is used anywhere, but I'm not sure. Basically, this feature provides the ability to create an observable that reflects another observable's events 1:1 until a subscription is called. Perhaps this ability is not very useful, or perhaps it could be accomplished in a more clear way.