MohitDecodes
Back to blogsJavaScript

Async/Await, Promise.all, and Promise.allSettled Without Traps

October 28, 2026 · 6 min read

`async`/`await` makes asynchronous code look synchronous — which also makes it easy to accidentally run independent API calls one after another instead of in parallel.

Avoid accidental waterfalls

// Slow: waits for user before even starting posts
const user = await fetchUser();
const posts = await fetchPosts();

// Fast: both requests start at the same time
const [user, posts] = await Promise.all([fetchUser(), fetchPosts()]);

Promise.all vs Promise.allSettled

`Promise.all` fails fast: if one promise rejects, the whole `await` throws and you lose the other results. When loading independent dashboard widgets where partial data is still useful, reach for `Promise.allSettled`.

  • Use `Promise.all` when every request is required to render or commit.
  • Use `Promise.allSettled` when independent widgets or non-critical API calls can fail gracefully.
  • Never forget `try/catch` around `await`, especially inside event handlers and `useEffect` callbacks.