prefn

0.0.2 • Public • Published

prefn

NPM package Build Status License

Description

JavaScript simple functional extension.

Usage

preparation

let f = x => x + 10
let g = x => x * 2
let plus = (a,b,c) => a + b + c;
compose
let h = f.compose(g);
h(1) // 12
andThen
let h = f.andThen(g);
h(1) // 22
curried
let f = plus.curried();
f(1,2,3) // 6
f(1)(2,3) // 6
f(1)(2)(3) // 6
f(1,2)(3) // 6
partial
let f = plus.partial(1, undefined, 3);
f(1) // 5
f(2) // 6
f(3) // 7

Installation

npm

Install

$ npm i -D prefn

Use

require('prefn');

Author

to4iki

Licence

MIT

Readme

Keywords

Package Sidebar

Install

npm i prefn

Weekly Downloads

2

Version

0.0.2

License

MIT

Last publish

Collaborators

  • to4iki