mapErr<W extends Object> method

FutureResult<S, W> mapErr<W extends Object>(
  1. FutureOr<W> fn(
    1. F error
    )
)

Implementation

FutureResult<S, W> mapErr<W extends Object>(
    FutureOr<W> Function(F error) fn) {
  return mapOrElse(
    (error) async {
      return Err(await fn(error));
    },
    Ok.new,
  );
}