apr-compose
Advanced tools
Comparing version 1.0.1 to 1.0.2
24
index.js
const waterfall = require('apr-waterfall'); | ||
const reverse = require('lodash.reverse'); | ||
/** | ||
* <a id="sompose"></a> | ||
* Creates a function which is a composition of the passed asynchronous functions. Each function consumes the return value of the function that follows. Composing functions f(), g(), and h() would produce the result of f(g(h())). | ||
* | ||
* [![](https://img.shields.io/npm/v/apr-compose.svg?style=flat-square)](https://www.npmjs.com/package/apr-compose) [![](https://img.shields.io/npm/l/apr-compose.svg?style=flat-square)](https://www.npmjs.com/package/apr-compose) | ||
* | ||
* @kind function | ||
* @name compose | ||
* @param {Function} function | ||
* @returns {Function} | ||
* | ||
* @example | ||
* import compose from 'apr-compose'; | ||
* | ||
* const then = (v) => new Promise((resolve) => resolve(v)); | ||
* | ||
* const composed = compose( | ||
* async (v) => await then(v + 1), | ||
* async (v) => await then(v + 2), | ||
* async (v) => await then(v + 3) | ||
* ); | ||
* | ||
* const output = await composed(1); // 7 | ||
*/ | ||
module.exports = (...args) => { | ||
@@ -5,0 +29,0 @@ return (value) => { |
{ | ||
"name": "apr-compose", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"homepage": "https://github.com/ramitos/apr/tree/master/packages/compose", | ||
@@ -11,5 +11,5 @@ "license": "MIT", | ||
"dependencies": { | ||
"apr-waterfall": "^1.0.1", | ||
"apr-waterfall": "^1.0.2", | ||
"lodash.reverse": "^4.0.1" | ||
} | ||
} |
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
2635
3
32
1
31
0
Updatedapr-waterfall@^1.0.2