Skip to content

Commit

Permalink
Replace SubscriptionList with CompositeSubscription in RxPresenter
Browse files Browse the repository at this point in the history
SubscriptionList is RxJava's internal type so we shouldn't use it. Note
that the APIs are nearly identical so this change doesn't require any
more work than switching the type.
  • Loading branch information
Plastix committed May 18, 2016
1 parent 613a42e commit 1c4f437
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions nucleus/src/main/java/nucleus/presenter/RxPresenter.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
import rx.functions.Action1;
import rx.functions.Action2;
import rx.functions.Func0;
import rx.internal.util.SubscriptionList;
import rx.subjects.BehaviorSubject;
import rx.subscriptions.CompositeSubscription;

/**
* This is an extension of {@link Presenter} which provides RxJava functionality.
Expand All @@ -30,7 +30,7 @@ public class RxPresenter<View> extends Presenter<View> {
private static final String REQUESTED_KEY = RxPresenter.class.getName() + "#requested";

private final BehaviorSubject<View> views = BehaviorSubject.create();
private final SubscriptionList subscriptions = new SubscriptionList();
private final CompositeSubscription subscriptions = new CompositeSubscription();

private final HashMap<Integer, Func0<Subscription>> restartables = new HashMap<>();
private final HashMap<Integer, Subscription> restartableSubscriptions = new HashMap<>();
Expand All @@ -48,7 +48,7 @@ public Observable<View> view() {

/**
* Registers a subscription to automatically unsubscribe it during onDestroy.
* See {@link SubscriptionList#add(Subscription) for details.}
* See {@link CompositeSubscription#add(Subscription) for details.}
*
* @param subscription a subscription to add.
*/
Expand All @@ -58,7 +58,7 @@ public void add(Subscription subscription) {

/**
* Removes and unsubscribes a subscription that has been registered with {@link #add} previously.
* See {@link SubscriptionList#remove(Subscription)} for details.
* See {@link CompositeSubscription#remove(Subscription)} for details.
*
* @param subscription a subscription to remove.
*/
Expand Down

0 comments on commit 1c4f437

Please sign in to comment.