resolveAllReduced<R> method
Resolves all elements and reduce them with reducer
.
Implementation
FutureOr<T> resolveAllReduced<R>(T Function(T value, T element) reducer) {
var self = this;
if (_isNotFuture(T) && self is Iterable<T>) {
return self.reduce(reducer);
}
var all = allAsList;
if (all.isEmpty) return <T>[].reduce(reducer);
if (all.isAllResolved) {
var l = all.cast<T>();
return l.reduce(reducer);
} else {
return Future.wait(all.asFutures).resolveMapped((l) {
return l.reduce(reducer);
});
}
}