onEach

inline fun <T : Any> FetchFlow<T>.onEach(crossinline prefetch: suspend Prefetch.() -> Unit = {}, crossinline fetching: suspend Fetching<T>.() -> Unit = {}, crossinline finished: suspend Finished<T>.() -> Unit = {}): FetchFlow<T>

On each emission, execute a lambda according to Fetch state.

Receiver

The FetchFlow to perform actions on.

Return

The original FetchFlow.

Parameters

T

The type of the Fetch value.

prefetch

Action when emission contains Prefetch.

fetching

Action when emission contains Fetching.

finished

Action when emission contains Finished.