pipeFailure<T extends Object> method

  1. @override
  2. @useResult
Future<Result<S, T>> pipeFailure<T extends Object>(
  1. Future<Result<S, T>> function(
    1. F failure
    )
)
override

If this is a Failure, asynchronously maps F to Result, otherwise returns S untouched.

See bindFailure for a synchronous variant of this function.

Future<String> stringifyAsync(int value) async => Success(v.toString());

Success(1).pipeFailure(stringifyAsync); // Success(1)

Failure(2).pipeFailure(stringifyAsync); // Success('2')

Implementation

@override
@useResult Future<Result<S, T>> pipeFailure<T extends Object>(Future<Result<S, T>> Function(F failure) function) async => Success(success);