1.0.0 • Published 9 years ago
promise-or v1.0.0
promise-or
The OR (||) operator for promises
Installation
Install promise-or
using npm:
npm install --save promise-or
Usage
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
9 years ago