Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

typescript get promise allsettled

/* 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);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #typescript #promise #allsettled
ADD COMMENT
Topic
Name
8+8 =