Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/boo1ean/pflow

Compose promised functions into flow
https://github.com/boo1ean/pflow

Last synced: 30 days ago
JSON representation

Compose promised functions into flow

Awesome Lists containing this project

README

        

## pflow

Create flow of promised functions. Same as [lodash.flow](https://lodash.com/docs#flow) but handles promises.

## Installation

```
npm install pflow
```

## Usage

```javascript
var Promise = require('bluebird');
var flow = require('pflow');

function inc (x) {
return Promise.resolve(x + 1);
}

var inc3 = flow(inc, inc, inc);

inc3(0).then(function (x) {
console.log(x); // 3
});
```