//[tvlib](../../../index.md)/[org.mjdev.tvlib.viewmodel](../index.md)/[BaseViewModel](index.md)
# BaseViewModel
[androidJvm]\
open class [BaseViewModel](index.md) : [ViewModel](https://developer.android.com/reference/kotlin/androidx/lifecycle/ViewModel.html)
## Constructors
| | |
|---|---|
| [BaseViewModel](-base-view-model.md) | [androidJvm]
constructor() |
## Functions
| Name | Summary |
|---|---|
| [addCloseable](index.md#264516373%2FFunctions%2F-1596939238) | [androidJvm]
open fun [addCloseable](index.md#264516373%2FFunctions%2F-1596939238)(@[NonNull](https://developer.android.com/reference/kotlin/androidx/annotation/NonNull.html)p0: [Closeable](https://developer.android.com/reference/kotlin/java/io/Closeable.html)) |
| [async](async.md) | [androidJvm]
fun <[T](async.md)> [async](async.md)(block: suspend CoroutineScope.() -> [T](async.md)): [MutableLiveData](https://developer.android.com/reference/kotlin/androidx/lifecycle/MutableLiveData.html)<[T](async.md)> |
| [equals](../../org.mjdev.tvlib.webscrapper.select/-element-not-found-exception/index.md#585090901%2FFunctions%2F-1596939238) | [androidJvm]
open operator fun [equals](../../org.mjdev.tvlib.webscrapper.select/-element-not-found-exception/index.md#585090901%2FFunctions%2F-1596939238)(other: [Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)?): [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) |
| [handleError](handle-error.md) | [androidJvm]
fun [handleError](handle-error.md)(block: (error: [Throwable](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html)) -> [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)) |
| [hashCode](../../org.mjdev.tvlib.webscrapper.select/-element-not-found-exception/index.md#1794629105%2FFunctions%2F-1596939238) | [androidJvm]
open fun [hashCode](../../org.mjdev.tvlib.webscrapper.select/-element-not-found-exception/index.md#1794629105%2FFunctions%2F-1596939238)(): [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) |
| [postError](post-error.md) | [androidJvm]
fun [postError](post-error.md)(e: [Throwable](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html)) |
| [stateInViewModel](state-in-view-model.md) | [androidJvm]
fun <[T](state-in-view-model.md)> Flow<[T](state-in-view-model.md)>.[stateInViewModel](state-in-view-model.md)(initial: [T](state-in-view-model.md)): StateFlow<[T](state-in-view-model.md)>
fun <[T](state-in-view-model.md)> Flow<[List](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)<[T](state-in-view-model.md)>>.[stateInViewModel](state-in-view-model.md)(initial: [List](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)<[T](state-in-view-model.md)> = listOf()): StateFlow<[List](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)<[T](state-in-view-model.md)>>
fun <[K](state-in-view-model.md), [V](state-in-view-model.md)> Flow<[Map](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-map/index.html)<[K](state-in-view-model.md), [V](state-in-view-model.md)>>.[stateInViewModel](state-in-view-model.md)(initial: [Map](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-map/index.html)<[K](state-in-view-model.md), [V](state-in-view-model.md)> = mapOf()): StateFlow<[Map](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-map/index.html)<[K](state-in-view-model.md), [V](state-in-view-model.md)>> |
| [toString](../../org.mjdev.tvlib.webscrapper.select/-element-not-found-exception/index.md#1616463040%2FFunctions%2F-1596939238) | [androidJvm]
open fun [toString](../../org.mjdev.tvlib.webscrapper.select/-element-not-found-exception/index.md#1616463040%2FFunctions%2F-1596939238)(): [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) |
## Properties
| Name | Summary |
|---|---|
| [error](error.md) | [androidJvm]
val [error](error.md): MutableStateFlow<[Throwable](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html)?> |