recover method

  1. @override
Success<T> recover(
  1. T onRecover(
    1. ErrorMessage errorMessage
    )
)
override

Recovers from a failure by providing a new value.

onRecover is the function that provides a new value in case the result is a failure.

Implementation

@override
Success<T> recover(T Function(ErrorMessage errorMessage) onRecover) =>
    Success(onRecover(error));