map

fun <T, R> Result<T>.map(block: (T) -> Result<R>): Result<R>

Transforms a successful result using block, propagating Result.Loading, Result.Empty, and Result.Error unchanged.

Return

The transformed result, or the original non-success state.

Parameters

block

Transformation applied to the data of a Result.Success.