compose-fn

0.0.2 • Public • Published

compose-fn

A JavaScript library for writing composable functions.

Install

npm install --save compose-fn

Syntax

compose(initialVal, fn_1[, fn_2, ..., fn_n);

compose() takes an initialVal, passing it to fn_1(). The result of which is passed to fn_2(), etc.

Use

var compose = require('compose-fn');

function foo(a) { return a * 2; }
function bar(b) { return b + 1; }
function baz(c) { return c % 3; }

var result = compose(2, foo, bar, baz);
// => 2 

Readme

Keywords

none

Package Sidebar

Install

npm i compose-fn

Weekly Downloads

0

Version

0.0.2

License

ISC

Last publish

Collaborators

  • tylerrash