promise-or
v1.0.0
Published
The OR (||) operator for promises
Maintainers
Readme
promise-or
The OR (||) operator for promises
Installation
Install promise-or using npm:
npm install --save promise-orUsage
Module usage
var or = require('promise-or');
or(Promise.resolve(false), Promise.resolve(true))
.then(function (val) {
// val === true
});API
or(...args)
| Name | Type | Description |
|------|------|-------------|
| ...args | Mixed| Values to run || between |
Returns: Promise, which resolvs to the first "truthy" value among the arguments.
Related
License
MIT © Joakim Carlstein
