CombinedCollectionLiveData
Similar to MediatorLiveData, but with a few key differences:
There's a single function to update the value when any of the sources change.
Updating multiple sources simultaneously only results in a single value update.
Consistent with kotlinx.coroutines.flow.combine, calculateValue will only be called when all added sources have a value set (even if that value is null
). Until then, the returned LiveData's value will be unset and observers will not receive callbacks.
Parameters
Constructors
Inherited properties
Functions
Adds a source, triggering a value update. Any future change to the added source's value will also trigger a value update.
Removes a source, triggering a value update. Any future change to the added source's value will no longer trigger a value update.
Replaces all sources, triggering a value update. Any future change to any of the new sources' values will also trigger a value update.