mapErrAsync<F extends Object> method

Future<TaskResult<T, F>> mapErrAsync<F extends Object>(
  1. FutureOr<F> op(
    1. E error
    )
)

This is the async version of mapOrElse.

Implementation

Future<TaskResult<T, F>> mapErrAsync<F extends Object>(FutureOr<F> Function(E error) op) async {
  if (isErr) {
    return Err(await op(error!));
  }
  return Ok(data!);
}