fold<U> method
U
fold<U>(
- U onSuccess(
- T
- U onFailure(
- E
Folds this result into a single value using the appropriate function
Implementation
U fold<U>(U Function(T) onSuccess, U Function(E) onFailure) => switch (this) {
Success(value: final value) => onSuccess(value),
Failure(error: final error) => onFailure(error),
};