1.0.0 • Published 10 years ago
promise-or v1.0.0
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
1.0.0
10 years ago