fold<W> method

  1. @override
W fold<W>(
  1. W onSuccess(
    1. S succcess
    ),
  2. W onFailure(
    1. F failure
    )
)
override

Returns the result of onSuccess for the encapsulated value if this instance represents Success or the result of onError function for the encapsulated value if it is Failure.

Implementation

@override
W fold<W>(
  W Function(S succcess) onSuccess,
  W Function(F failure) onFailure,
) {
  return onFailure(_failure);
}