getOrElse

inline suspend fun <R> Flow<AsyncResult<R>>.getOrElse(noinline transform: (Error) -> R): R

Obtains the first terminal value of the flow, and if it is a Success, it returns the encapsulated value. Otherwise, it returns the result of the given transform function.


inline fun <R> AsyncResult<R>.getOrElse(transform: (AsyncResult<R>) -> R): R

Returns the value if the AsyncResult is Success else returns the result of the transform function.