The AND (&&) operator for promises
Install promise-and using npm:
npm install --save promise-andvar and = require('promise-and');
and(Promise.resolve(true), Promise.resolve(false))
.then(function (val) {
// val === false
});| Name | Type | Description |
|---|---|---|
...args |
Mixed |
Values to run && between |
Returns: Promise, which resolves to the first "falsey" value among the arguments.
MIT © Joakim Carlstein