forEach<T> static method
Implementation
static AsyncLoop forEach<T>(
Iterable<T> itr, FutureOr<bool> Function(T e) block) {
if (itr is List<T>) {
return AsyncLoop<int>(
0, (i) => i < itr.length, (i) => i + 1, (i) => block(itr[i]));
} else {
var iterator = itr.iterator;
return AsyncLoop<int>(0, (i) => iterator.moveNext(), (i) => i + 1,
(_) => block(iterator.current));
}
}