2.0.1 • Published 8 years ago

bluebird-ff v2.0.1

Weekly downloads
627
License
MIT
Repository
github
Last release
8 years ago

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.

2.0.1

8 years ago

2.0.0

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago