-
Using fetch with async/await
-
use Promise.allSettled() instead of Promise.all()
- promises
- Using Promise.all() has potential dangers because if one of the promises fail, the rest of the promises run but we never get back the response. The resolved promises are lost in the void.
- Use Promise.allSettled() instead because what this returns is an array of results with status and resolved value of each promise.
- Using Promise.allSettled() makes us do a bit of extra work to process the resolve and rejects separately but its for the good.
- {{embed ((64958d37-5aba-4a90-a9b2-40dd81e93984))}}