package com.aaron.kakao.hospitalmapfortube.ui.main

import android.util.Log
import com.aaron.kakao.hospitalmapfortube.core.BaseViewModel
import com.aaron.kakao.hospitalmapfortube.data.remote.api.MapAPI
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers

/**
 * Created by aaron on 2020-03-26
 */

class MainViewModel(private val api: MapAPI) : BaseViewModel() {
    fun getCategory() {
        addToDisposable(api.getCategory("H8")
            .subscribeOn(Schedulers.io())
            .observeOn(AndroidSchedulers.mainThread())
            .subscribe({category ->
               if (category != null) {
                   Log.d("aaron", category.toString())
               }
            },{})
        )
    }
}