fold<W> method
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);
}