fold

inline fun <T : Any, Output> Fetch<T>.fold(initial: () -> Output, fetching: () -> Output, finished: (result: T) -> Output): Output

Transform each Fetch status into an Output.

Receiver

The Fetch to fold.

Return

The folded value of type Output.

Parameters

T

The type of the Fetch value.

Output

The type of the folded value.

initial

The lambda to transform the Fetch.Initial status into an Output.

fetching

The lambda to transform the Fetch.Fetching status into an Output.

finished

The lambda to transform the Fetch.Finished status into an Output.