mapFinished

inline fun <In : Any, Out : Any> Fetch<In>.mapFinished(transform: (result: In) -> Out): Fetch<Out>

Transform a finished fetch result.

  • Unlike fold, mapFinished re-wraps the results of transform as finished.

  • This is a convenient alias for fold, because usually only the finished branch is interesting.

Receiver

The Fetch to transform.

Return

The transformed Fetch of type Out.

Parameters

In

The type of the Fetch value.

Out

The type of the transformed value.

transform

The lambda to transform the result into an Out.