-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Closed
Description
When you have the list of values to be passed to the same function sequentially, so that the next call is only made only when the promise returned by the previous call is resolved, you either have to "manually" chain promises or use Promise.reduce, which both looks a bit ugly and also not so obvious.
It could be nice to have something like this:
Promise.series = function (arr, iteratorAsync) {
return Promise.reduce(arr, function(memo, item) {
return iteratorAsync(item);
}, 0);
}
Metadata
Metadata
Assignees
Labels
No labels