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

addDirectSource

[androidJvm]
Content
@MainThread()

inline fun <T> MediatorLiveData<in T>.addDirectSource(source: LiveData<out T>)
More info

Starts to listen the given source LiveData. Whenever source value is changed, it is set as a new value of this MediatorLiveData.

If the given LiveData is already added as a source IllegalArgumentException will be thrown.

Equivalent to:

mediatorLiveData.addSource(liveData) { x -> mediatorLiveData.value = x }