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