GCX-HCI / ThirtyInch

a MVP library for Android favoring a stateful Presenter
Apache License 2.0
1.03k stars 101 forks source link

Add clear to Rx*Handler #62

Closed StefMa closed 7 years ago

StefMa commented 7 years ago

In the real world it could be happen that we want to clear all the subscriptions / disposables ,which are already added to the handler via manage*, earlier than the handler does .

So it would be great if you can provide a clear method to the Rx*Handler 👍

passsy commented 7 years ago

Already prepared a PR for this. Then I came to the conclusion that there is not a single case when you want to clear those subscriptions earlier. Those manage* methods are for exactly one usecase, unsubscribing when a specific lifecycle callback gets called. When you want to unsubscribe all Subscriptions earlier you should manage them yourself.

When we'd add a clear() method you could accidentally unsubscribe things which aren't meant to be unsubscribed. Especially challenging in larger teams