package com.hanwha.morakmorak.core

import android.view.View
import androidx.lifecycle.ViewModel
import com.hanwha.morakmorak.util.NotNullMutableLiveData
import io.reactivex.disposables.CompositeDisposable
import io.reactivex.disposables.Disposable
import timber.log.Timber

/**
 * Created by aaron on 06/09/2019
 */
open class BaseViewModel : ViewModel() {

    var toolbarLeftFirstClick = { v: View -> Timber.i("${v.id}.toolbarLeftFirstClick!!!") }
    var toolbarLeftSecondClick = { v: View -> Timber.i("${v.id}.toolbarLeftSecondClick!!!") }
    var toolbarRightFirstClick = { v: View -> Timber.i("${v.id}.toolbarRightFirstClick!!!") }
    val isProgressVisible = NotNullMutableLiveData(false)

    private val disposables: CompositeDisposable = CompositeDisposable()

    fun addToDisposable(disposable: Disposable) {
        disposables.add(disposable)
    }

    override fun onCleared() {
        disposables.clear()
        super.onCleared()
    }
}