fold<B> abstract method
B
fold<B>(
- B ok(
- O ok
- B err(
- E err
Breaks the result into Ok
or Err
.
The values are exposed in the callback parameter.
Returns a single value from both of the callbacks.
Example:
final result = ok<String, Exception>('hi');
result.fold(
(ok) => print(ok),
(err) => print(err),
);
Implementation
B fold<B>(B Function(O ok) ok, B Function(E err) err);