Skip to content

Instantly share code, notes, and snippets.

@sibelius
Created October 6, 2016 17:31
Show Gist options
  • Save sibelius/2142604dad92c92e9198380860d12098 to your computer and use it in GitHub Desktop.
Save sibelius/2142604dad92c92e9198380860d12098 to your computer and use it in GitHub Desktop.
Promise.all limit
let start = 0;
const limit = 10;
items.slice(start, limit).forEach(subset =>
await Promise.all(subset.map(async (item) => {
// do async work with a single item
}))
.then(() => (start += limit)
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment