You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

52 lines
1.5 KiB

4 years ago
  1. # curri
  2. <img alt="curri.js" src="https://cdn.rawgit.com/GianlucaGuarini/curri/master/curri.gif" width="50%"/>
  3. > `curri` in some Italian :it: dialects means `run`
  4. [![Build Status][travis-image]][travis-url]
  5. [![NPM version][npm-version-image]][npm-url]
  6. [![NPM downloads][npm-downloads-image]][npm-url]
  7. [![MIT License][license-image]][license-url]
  8. ## Usage
  9. ```js
  10. import curry from 'curri'
  11. const add = (a, b) => a + b
  12. const add3 = curry(add)(3)
  13. console.log(add3(5)) // 8
  14. ```
  15. [travis-image]: https://img.shields.io/travis/GianlucaGuarini/curri.svg?style=flat-square
  16. [travis-url]: https://travis-ci.org/GianlucaGuarini/curri
  17. [license-image]: http://img.shields.io/badge/license-MIT-000000.svg?style=flat-square
  18. [license-url]: LICENSE
  19. [npm-version-image]: http://img.shields.io/npm/v/curri.svg?style=flat-square
  20. [npm-downloads-image]: http://img.shields.io/npm/dm/curri.svg?style=flat-square
  21. [npm-url]: https://npmjs.org/package/curri
  22. ## API
  23. <!-- Generated by documentation.js. Update this documentation by updating the source code. -->
  24. ### curry
  25. Function to curry any javascript method
  26. **Parameters**
  27. - `fn` **[Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function)** the target function we want to curry
  28. - `acc` **...\[args]** initial arguments
  29. Returns **([Function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function) | any)** it will return a function until the target function
  30. will receive all of its arguments