New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ql

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ql

Use logic to compose promises

  • 0.1.5
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
429
increased by25.44%
Maintainers
1
Weekly downloads
 
Created
Source

QL - Q with logic

This very simple library adds logic operators to compose promises. Operators added:

  • asyncRejectOnFirstRejected (rejects as soon as one of the input promises is rejected)
  • syncResolveOnAllResolved (rejects when all promises are completed and at least one of them is rejected)
  • not
  • asyncResolveOnFirstResolved (resolves as soon as one of the input promises is resolved.)
  • syncRejectOnAllRejected (resolves when all promises are completed and at least one of them is resolved.)

Installation:

npm install ql

Usage:

The library extends Q:

Q = require('ql');
...
p1 = myAjaxCallReturningAPromise()
p2 = myOtherCallReturningAPromise()
...
Q.asyncResolveOnFirstResolved(p1,Q.not(p2)).then(function() {
    console.log("Either p1 succeeded or p2 failed");
    })

Keywords

FAQs

Package last updated on 30 May 2014

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