flowright

0.0.1 • Public • Published

flowRight

Function composition from right to left.

Install

npm install flowright
bower install flowright

Usage

var flowRight = require('flowright');
 
function square(n) {
  return n * n;
}
 
function add(/* args */) {
  var result = 0, i = arguments.length;
  while(i--) result += arguments[i];
  return result;
}
 
var addSquare = flowRight(square, add);
 
console.log(addSquare(1, 2)); // 9
console.log(addSquare(1, 2, 3)); // 36
console.log((addSquare(2)); // 4

License

MIT

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.1
    2
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.0.1
    2

Package Sidebar

Install

npm i flowright

Weekly Downloads

2

Version

0.0.1

License

MIT

Last publish

Collaborators

  • miguelmota