orElse<F2 extends Object> method

FutureResult<S, F2> orElse<F2 extends Object>(
  1. FutureOr<Result<S, F2>> fn(
    1. F
    )
)

Implementation

FutureResult<S, F2> orElse<F2 extends Object>(
    FutureOr<Result<S, F2>> Function(F) fn) {
  return mapOrElse(
    (error) {
      return fn(error);
    },
    Ok.new,
  );
}