forEach

fun <E> LiveData<out Iterable<E>?>.forEach(operation: (E) -> Unit)

Performs operation on each entry in a LiveData's collection. Does nothing if the LiveData has no value.


fun <K, V> LiveData<out Map<K, V>>.forEach(operation: (Map.Entry<K, V>) -> Unit)

Performs operation on each entry in a LiveData's Map. Does nothing if the LiveData has no value.