One failed widget blanks an entire dashboard
A dashboard loads three independent widgets. If any request fails, a single catch around Promise.all replaces the entire dashboard with an error. Some widgets are optional. What would you change, what order would you expect the results in, and what happens to the other requests when one rejects?
Model Answer & Explanation
Use Promise.allSettled and render from each result’s status, or handle optional failures per request while keeping required failures fatal. Both all and allSettled return results in input order when they fulfill. Rejecting the aggregate from all does not cancel the remaining operations. Explicit cancellation, if appropriate, is a separate choice.
What a Strong Answer Covers
- Choose an approach that preserves successful results.
- Separate ordered results from settlement timing and cancellation.