Thanks to visit codestin.com
Credit goes to github.com

Skip to content

joakimbeng/promise-or

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

promise-or

Build status NPM version js-xo-style

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

Returns: Promise, which resolvs to the first "truthy" value among the arguments.

Related

License

MIT © Joakim Carlstein

About

The OR (||) operator for promises

Resources

Stars

Watchers

Forks

Packages

No packages published