1async function loadDashboard() {
2 const [users, orders, products] = await Promise.all([
3 fetch('/api/users').then(r => r.json()),
4 fetch('/api/orders').then(r => r.json()),
5 fetch('/api/products').then(r => r.json()),
6 ]);
7 return { users, orders, products };
8}
no lines flagged
#014PracticeMedium18 min · 120 XP
Promise.all Fails Fast Without Recovery
A dashboard that fetches three independent data sources crashes entirely if any single source fails.
Flagged linesNo lines flagged yet
What's wrong?
Flag a line or write a note to submit.