@pakal/curry
Curry is package from Pakal library
Install
$ yarn add @pakal/curry
Or
$ npm install --save @pakal/curry
Use
Module
import {
IPlaceholder,
__,
CurriedFn,
CurriedFn2,
CurriedFn3,
CurriedFn4,
CurriedFn5,
default as curry
} from '@pakal/curry';
Browser
<script src="https://unpkg.com/@pakal/curry/bundle.umd.min.js"></script>
let {
__,
curry
} = _;
Examples
let multiply = (a, b)=> a * b;
let multiplyCurried = curry(multiply);
multiplyCurried()(2)()(4); // => 8
let fn = (a, b, c, d, e) => [a, b, c, d, e];
let curriedFn = curry(fn);
curriedFn(__, __, 1, __, 2)(__, 3)(4, 5); // => [4, 3, 1, 5, 2]
License
Copyright © Yisrael Eliev, Licensed under the MIT license.