bluebird-ff

Functional/Control-Flow utilities for Bluebird

bluebird-ff downloads bluebird-ff version bluebird-ff license

bluebird-ffSimilar Packages:
Npm Package Weekly Downloads Trend
3 Years
🌟 Show real-time usage chart on bluebird-ff's README.md, just copy the code below.
## Usage Trend
[![Usage Trend of bluebird-ff](https://npm-compare.com/img/npm-trend/THREE_YEARS/bluebird-ff.png)](https://npm-compare.com/bluebird-ff#timeRange=THREE_YEARS)
Cumulative GitHub Star Trend
🌟 Show GitHub stars trend chart on bluebird-ff's README.md, just copy the code below.
## GitHub Stars Trend
[![GitHub Stars Trend of bluebird-ff](https://npm-compare.com/img/github-trend/bluebird-ff.png)](https://npm-compare.com/bluebird-ff)
Stat Detail
Package
Downloads
Stars
Size
Issues
Publish
License
bluebird-ff2,4420-0-MIT
README for bluebird-ff

bluebird-ff

Build Status Coverage Status

Usage

The library can be used as a bluebird replacement:

var Promise = require('bluebird-ff');

You can use it as standalone functions:

var bff = require('bluebird-ff/ff');

Also, you can "install" it on a target:

var Promise = require("bluebird/js/main/promise")();

require('bluebird-ff/ff').install(Promise.prototype);

module.exports = Promise;

Functions

pif(test, consequent, alternate)

Calls consequent if test succeeds, otherwise, calls alternate.

when(test, consequent)

Calls consequent only if test succeeds.

unless(test, consequent)

Calls consequent only if test fails.

and(fn)

Useful for chaining several results, example:

return Promise.resolve(customerIds)
.then(loadCustomers)
.and(loadTransactionsFromCustomers)
.then(function(customers, transactions) {
	...
});

propsWithErrors(promises)

Like Promise.props, but returning AggregateError with each error.

License

Check here.