Skip to content

Instantly share code, notes, and snippets.

@inneroot
Created June 16, 2020 13:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save inneroot/387aed7a8be32fca0654ea2fd0329de6 to your computer and use it in GitHub Desktop.
Save inneroot/387aed7a8be32fca0654ea2fd0329de6 to your computer and use it in GitHub Desktop.
Concurrent loop through array of Promises
callApi = [url1, url2, url3]
const pormiseArr = callApi.map(v => getFromApi(v))
const ConcurrentLoop = async() => {
for await (const resolvedPromise in pormiseArr) {
console.log(resolvedPromise)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment