package com.duben.microtribe.mvp.presenters;

import com.duben.microtribe.MintsApplication;
import com.duben.microtribe.net.LoanService;

import rx.Subscription;

/**
 * 描述：BasePresenter
 * 作者：孟崔广
 * 时间：2018/1/10 17:51
 * 邮箱：mengcuiguang@cashbang.cn
 */
public class BaseTrackPresenter implements Presenter<MintsApplication> {

    protected MintsApplication loanApplication;
    protected LoanService loanService;

    protected Subscription subscription;

    @Override
    public void attachView(MintsApplication loanApplication) {
        this.loanApplication = loanApplication;
        loanService = loanApplication.getLoanService();
    }

    @Override
    public void detachView() {
        if (subscription != null && !subscription.isUnsubscribed()) {
            subscription.unsubscribe();
        }
    }
}
