consume

fun <T : Any> LiveData<OnceEvent<T>>.consume(owner: LifecycleOwner, block: (T) -> Unit): Observer<OnceEvent<T>>

Consume the event as dispatched from the data object.

Return

The observer.

Parameters

owner

The owner to observe the data object for.

block

The block to execute on consumption.