0.2.1 • Published 6 years ago

@pakal/curry v0.2.1

Weekly downloads
64
License
MIT
Repository
github
Last release
6 years ago

@pakal/curry

Source Code Version MIT License Bundle Size TypeScript

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.