Promise.allSettled
小于 1 分钟
Promise.allSettled
类型
interface PromiseConstructor {
allSettled<T>(
iterable: Iterable<Promise<T>>
): Promise<PromiseSettledResult<T>>;
}
type PromiseSettledFulfilledResult<T> = {
status: "fulfilled";
value: T;
};
type PromiseSettledRejectedResult = {
status: "rejected";
reason: any;
};
type PromiseSettledResult<T> =
| PromiseSettledFulfilledResult<T>
| PromiseSettledRejectedResult;
入口点
core-js/proposals/promise-all-settled