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
The type of the input. I.e., the source LiveData values.
The type of the output LiveData value.
A method that calculates the value for this LiveData after one or more sources are updated.
Constructors
Inherited properties
Functions
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.