package com.colorful.keyboard.theme.net;

import rx.Observable;
import rx.Subscriber;
import rx.android.schedulers.AndroidSchedulers;
import rx.schedulers.Schedulers;
import rx.subscriptions.CompositeSubscription;


public class NetUtil {

    public static ApiStores mBBMApiStores = AppClient.getWorkerRetrofit().create(ApiStores.class);
    public static CompositeSubscription mCompositeSubscription;

    public static void getNetData(Observable observable, Subscriber subscriber) {
        if (mCompositeSubscription == null) {
            mCompositeSubscription = new CompositeSubscription();
        }
        mCompositeSubscription.add(observable
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe(subscriber));
    }
}
