mapAsyncSuccess<K> method

FutureOr<Result<K>> mapAsyncSuccess<K>(
  1. FutureOr<Result<K>> combiner(
    1. ResultType
    )
)

A method to chain asynchronous access to data held by the Result. If this is Failure returns [FutureOr<Failure>], if this is Success, returns the result of the combiner method over the data inside Success

Implementation

// ignore: empty_constructor_bodies
FutureOr<Result<K>> mapAsyncSuccess<K>(
  FutureOr<Result<K>> Function(ResultType) combiner,
) {
  return handle(
      onSuccess: (data) => combiner(data),
      onFailure: (error) => Failure(error));
}