flatMap

inline suspend fun <T, R> Outcome<T>.flatMap(transform: suspend (T) -> Outcome<R>): Outcome<R>

Flat-maps the value of a successful Outcome using the provided transform function.

Return

The Outcome produced by transform if successful, or the original Failure.

Parameters

transform

The function to transform the value of a Success into another Outcome.