combineOutcome<T extends Object> function
Combines an iterable of Outcomes into one containing a list of their values.
The result is an Async if any of the outcomes
are Async
If any resolvable contains an Err, applies onErr
to combine errors.
Implementation
Resolvable<List<Option<T>>> combineOutcome<T extends Object>(
Iterable<Outcome<T>> outcomes, {
@noFutures
Err<List<Option<T>>> Function(List<Result<Option<T>>> allResults)? onErr,
}) {
final reduced = outcomes.map((e) => e.reduce<T>());
return combineResolvable<Option<T>>(reduced, onErr: onErr);
}