fold<T> method

  1. @override
T fold<T>(
  1. T onError(
    1. Failure error
    ),
  2. T onSuccess(
    1. TSuccess r
    )
)
override

Executes the provided functions based on the result's state.

If the result is an error, onError is called with the error value. If the result is a success, onSuccess is called with the success value.

Implementation

@override
T fold<T>(
  T Function(Failure error) onError,
  T Function(TSuccess r) onSuccess,
) {
  return onSuccess(_value);
}