@nozbe/watermelondb
Version:
Build powerful React Native and React web apps that scale from hundreds to tens of thousands of records and remain fast
12 lines (11 loc) • 361 B
JavaScript
;
exports.__esModule = true;
exports.default = forEachAsync;
// Executes async action sequentially for each element in list (same as async for-of)
function forEachAsync(list, action) {
return list.reduce(function (promiseChain, element) {
return promiseChain.then(function () {
return action(element);
});
}, Promise.resolve());
}