Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

depend-async

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

depend-async

A small library that define multiple promises to be resolved asynchronously but without to resolve everything at once with the ability to grab the data from the previous promise result.

  • 1.0.1
  • unpublished
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

depend-async-js

A small library that define multiple promises to be resolved asynchronously but without to resolve everything at once with the ability to grab the data from the previous promise result.

Commands

"test": "vitest",
"test:ui": "vitest --ui",
"coverage": "vitest run --coverage",
"build": "yarn vite build --debug"
const resolve: Func<any> = (num: number, timeout?: number) => async (prev: any) => new Promise((resolve) => {
 timeout ?
  setTimeout(() => {
   resolve(num);
  }, timeout) :
  resolve(num);
});

const __test__ = await ResolvePromises([
  resolve(10), resolve(30), resolve(20),
  resolve(10), resolve(30), resolve(20),
  [
   resolve(10), resolve(30), resolve(20),
   resolve(10), resolve(30), resolve(20),
   resolve(10), resolve(30), resolve(20),
   (prev: any) => resolve(prev + 2)(prev + 2),
   (prev: any) => resolve(prev - 2)(prev - 2),
  ]
 ]);

 expect(__test__).toEqual([
  10, 30, 20,
  10, 30, 20,
  10, 30, 20,
  10, 30, 20,
  10, 30, 20, 22, 20
 ]);

Package size

 ES:
   normal: 0.26kb
   gzip: 0.20kb

 CJS:
   normal: 0.29kb
   gzip: 0.24kb

 UMD:
   normal: 0.49kb
   gzip: 0.34kb

Keywords

FAQs

Package last updated on 03 Sep 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc