CodeNewbie Community šŸŒ±

Discussion on: What's something you're struggling with?

Collapse
nickytonline profile image
Nick Taylor Author • Edited on

If you're making the two API calls and the second call doesn't depend on the first, use Promise.all. I'm assuming you're referring to a JS framework like React or Vue based on

pull data from two different API requests into one component

Not really understanding the second request being called multiple times potentially though. I'd need more context.

Collapse
j3ffjessie profile image
J3ffJessie

Right on. Using React, Axios has their own Axios.all that can handled the promise stuff. Trying to figure out a way to limit one call to only run once. The data will stay the same for one API request but the other request is handled by user input. Appreciate your advice.