Github user therajanmaurya commented on a diff in the pull request:
    --- Diff: 
    @@ -31,50 +31,48 @@
    +import io.reactivex.Observable;
    +import io.reactivex.ObservableSource;
    +import io.reactivex.disposables.CompositeDisposable;
    +import io.reactivex.functions.Function;
    +import io.reactivex.observers.DisposableObserver;
    +import io.reactivex.schedulers.Schedulers;
     import okhttp3.MediaType;
     import okhttp3.RequestBody;
     import okhttp3.ResponseBody;
    -import rx.Observable;
    -import rx.Observer;
    -import rx.Subscription;
    -import rx.functions.Func1;
    -import rx.schedulers.Schedulers;
     public class WorkflowRunPresenter extends 
BasePresenter<WorkflowRunMvpView> {
         private static final String TAG = 
    -    private final DataManager mDataManager;
    -    private Subscription mSubscriptions;
    +    private final DataManager mDataManager;
    +    private CompositeDisposable compositeDisposable;
         public WorkflowRunPresenter(DataManager dataManager) {
             mDataManager = dataManager;
    +        compositeDisposable = new CompositeDisposable();
         public void attachView(WorkflowRunMvpView mvpView) {
         public void detachView() {
    -        if (mSubscriptions != null) mSubscriptions.unsubscribe();
    +        compositeDisposable.clear();
         public void runWorkflow(String contentURL) {
    -        if (mSubscriptions != null) mSubscriptions.unsubscribe();
    +        compositeDisposable.clear();
    --- End diff --
    don't need to clear the Disposable, as we are using `CompositeDisposable` 
It manages every subscription we don't have to worry about, any subscription 
will drop or mix. clear only in detachView.


Reply via email to