//Extensions for Jetpack Lifecycle/it.czerwinski.android.lifecycle.livedata/merge

merge

[androidJvm]
Content
infix fun <T> LiveData<T>.merge(other: LiveData<T>): LiveData<T>
More info

Returns a LiveData emitting each value emitted by either this or other LiveData.

Example:

val serverError: LiveData = ... val databaseError: LiveData = ... val error: LiveData = serverError merge databaseError

[androidJvm]
Content
fun <T> merge(vararg sources: LiveData<T>): LiveData<T>
More info

Returns a LiveData emitting each value emitted by any of the given LiveData.

Example:

val serverError: LiveData = ... val databaseError: LiveData = ... val fileError: LiveData = ... val error: LiveData = merge(serverError, databaseError, fileError)