package com.mints.goodmoney.mvp.presenters;

import com.mints.goodmoney.MintsApplication;
import com.mints.goodmoney.net.LoanService;

import rx.Subscription;

/**
 * 描述：BasePresenter
 * 作者：孟崔广
 * 时间：2018/1/10 17:51
 * 邮箱：mengcga@163.com
 */
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();
        }
    }
}
