settle
Runs an array of promises concurrently and partitions the outcomes instead of
rejecting on the first failure, unlike Promise.all.
Built on top of Promise.allSettled, but returns fulfilled values and rejection
reasons already split apart so callers don’t need to inspect status themselves.
Available since next
Import
Section titled “Import”Signature
Section titled “Signature”Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
promises | readonly Promise<T>[] | Promises to run concurrently |
Returns
Section titled “Returns”Promise<object> — An object with fulfilled values and rejected reasons, each in input order
Examples
Section titled “Examples”Partition fulfilled and rejected outcomes
Section titled “Partition fulfilled and rejected outcomes”Runs promises concurrently and splits results instead of rejecting on the first failure.
All promises succeed
Section titled “All promises succeed”Returns an empty rejected array when nothing fails.
