fold<T> abstract method

T fold<T>(
  1. T onError(
    1. Failure l
    ),
  2. T onSuccess(
    1. TSuccess r
    )
)

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

T fold<T>(T Function(Failure l) onError, T Function(TSuccess r) onSuccess);