Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/boo1ean/pflow
- Owner: boo1ean
- Created: 2015-10-22T00:00:24.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2015-10-22T00:11:37.000Z (about 9 years ago)
- Last Synced: 2024-08-09T17:55:05.072Z (3 months ago)
- Language: JavaScript
- Size: 109 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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
});
```