0

I'm working on a React project where I have to make multiple API calls. So, the way I have been doing is using Promise.all(), but it returns all the results at the same time which sometimes too slow and bad for users' experience. I wonder if there is anyway that I can fetch all the APIs at the same time but still give the results separately so that I can display them in "first fetched first show" order?

Thi Nguyen
  • 49
  • 2
  • 6
  • Yea, each promise you pass to promise.all can have it's own resolve callbacks.. – Kevin B May 10 '22 at 20:52
  • do you know how I could achieve that? I have been doing like: ``` async function fetchData (){ const res = await Promise.all() console.log(res) } `` – Thi Nguyen May 10 '22 at 23:58

0 Answers0