UnsetLiveData
An empty LiveData implementation for situations where we need a LiveData instance which will never have a value.
Because no value is set, observers added to an instance of this class will not receive any callback, unlike with EmptyLiveData.
Inherited properties
Same as LiveData.getValue, except this variant throws a IllegalStateException when the LiveData instance does not have an active observer.
Same as LiveData.getValue with the exception that the returned value is up to date even when the LiveData instance does not have an observer.
Inherited functions
Transforms a LiveData containing a list of type T, which contains all the child elements from each element in this LiveData list by flattening it.
Transforms a LiveData containing a list of type T, which contains all the child elements from each element in this LiveData list together with its source, by flattening it.
Performs operation on each entry in a LiveData's collection. Does nothing if the LiveData has no value.
Executes and switchMaps to block if this has a true value. If this is false or null, it returns LiveData with value default. This can be used instead of ifTrue when the default value should be something other than null. Note that this requires a non-null value for T in order for Kotlin's compiler to properly spot missing null-checks.
Maps the value of the provided key, if that key exists in this map. Otherwise, no value is set. This is useful in cases where the map may not contain the requested entry but the resulting LiveData is not nullable as the client does not care about a null value. This removes the need for the client to have null checks in its code wherever the resulting LiveData is used.
Transforms LiveData containing a list that holds other LiveData instances into LiveData that contains the values from those LiveData instances. The returned LiveData will be updated when the source LiveData changes as well as when the internal LiveData instances change.
Observes this LiveData for one change only and returns the one-time observer. The returned observer can be used to stop observing the LiveData when a callback is no longer desired. It is safe to remove the observer while it is executing or has been executed already.