Promise.allSettled
A JavaScript function that waits for every promise in a list to finish and reports each one’s result, whether it succeeded or failed.
In more detail
Unlike Promise.all, which rejects as soon as one promise fails, allSettled always resolves with a status for every item. Callers can keep the successes and handle the failures one by one.
Related terms
- Promise — A JavaScript object that stands for a result that is not ready yet and will later either succeed with a value or fail with an error.
- graceful degradation — Continuing to work with reduced features when part of the system fails, instead of failing completely.
- aggregation — Combining data from several sources into one response.
Taught in
- API Gateway & BFF Patterns: Backend-for-Frontend — Production Full-Stack Engineering