andThen<U, F> method

ResultAsync<U, F> andThen<U, F>(
  1. FutureOr<Result<U, F>> f(
    1. T value
    )
)

Implementation

ResultAsync<U, F> andThen<U, F>(FutureOr<Result<U, F>> Function(T value) f) {
  return ResultAsync(this._future.then((res) {
    if (res.isErr()) {
      return Err<U, F>(res.asErr.error as F);
    }

    return f(res.asOk.value);
  }));
}