📜  typescript get promise allsettled - TypeScript 代码示例

📅  最后修改于: 2022-03-11 14:48:14.327000             🧑  作者: Mango

代码示例1
/* To get this running on Linux, I needed the latest typescript version: */

npm install -g typescript@latest

/* Then in your tsconfig you currently need the ES2020.Promise lib. */

{
  "compilerOptions": {
    "lib": [
      "ES2020.Promise",
    ]
  },
}

/* Usage: */ const results = await Promise.allSettled(BatchOfPromises);