Created
May 28, 2022 10:03
-
-
Save nivrith/dff62bb7d573053745a53bb68f7b5ef7 to your computer and use it in GitHub Desktop.
Async Iteration using for await (...) loop
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(async function () { | |
for await (const batch of batchTasks(tasks, 5)) { | |
console.log('batch', batch); | |
//Do something with the processed batch | |
renderPost(batch, appDiv); | |
} | |
loadingDiv.innerText = 'Loaded'; | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment