then

infix inline fun <T, R> ApiResult<T>.then(another: (T) -> ApiResult<R>): ApiResult<R>

Call another and if it succeeds, continue with another's result. If it fails, propagate the error. Effectively, flatMap to another result.

See also