onEachFetch

fun <T : Any> FetchFlow<T>.onEachFetch(initial: suspend Fetch.Initial.() -> Unit = {}, fetching: suspend Fetch.Fetching.() -> Unit = {}, fetched: suspend Fetch.Finished<T>.(T) -> Unit = {}): FetchFlow<T>

Perform non-mutating actions according to Fetch state on each flow emission.

Receiver

The FetchFlow to perform actions on.

Return

The original FetchFlow.

Parameters

T

The type of the Fetch value.

initial

The action to perform when the Fetch is initial.

fetching

The action to perform when the Fetch is in-progress.

fetched

The action to perform when the Fetch is finished.