You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Maybe I'm wrong but reading result documentation seems that it will return a new Result applying the appropriate function but it returns void. Something like a fold method.
If it isn't the expected behavior of the result, can you consider adding a fold method? Implementation should be like this:
Result<U, E> fold<U, E>(UFunction(S) success, EFunction(F) failure) {
if (isSuccess) {
final left =thisasSuccess<S, F>;
returnSuccess(success(left.value));
}
final right =thisasFailure<S, F>;
returnFailure(failure(right.value));
}
The text was updated successfully, but these errors were encountered:
Maybe I'm wrong but reading
result
documentation seems that it will return a newResult
applying the appropriate function but it returnsvoid
. Something like afold
method.dart_result_type/lib/src/result.dart
Lines 65 to 66 in 21b2ac2
If it isn't the expected behavior of the
result
, can you consider adding afold
method? Implementation should be like this:The text was updated successfully, but these errors were encountered: