How to use promise.all with forEach in javascript?

前端 未结 0 614
旧时难觅i
旧时难觅i 2020-12-10 01:36

I am making https requests in parallel for a given list of ids:

const posts = await Promise.all(usersIds.map(userId => fetchUserPosts(userId)));

相关标签:
回答
  • 消灭零回复
提交回复
热议问题