https://github.com/msn0/dead-simple-curry
:beer: Probably the simplest currying ever :)
https://github.com/msn0/dead-simple-curry
curry currying
Last synced: 9 months ago
JSON representation
:beer: Probably the simplest currying ever :)
- Host: GitHub
- URL: https://github.com/msn0/dead-simple-curry
- Owner: msn0
- Created: 2017-01-05T22:21:54.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-05-26T09:38:04.000Z (about 9 years ago)
- Last Synced: 2025-08-27T13:37:39.437Z (10 months ago)
- Topics: curry, currying
- Language: JavaScript
- Homepage:
- Size: 59.6 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# dead simple curry [](http://travis-ci.org/msn0/dead-simple-curry)
> Probably the simplest currying ever :)

# Installation
```
npm i dead-simple-curry --save
```
# Usage
Yes! It's dead simple.
```js
const curry = require('dead-simple-curry');
function multiply(a, b) {
return a * b;
}
const doubleMe = curry(multiply)(2);
doubleMe(3) → 6
doubleMe(7) → 14
// ...
```
Some more useful examples:
```js
import curry from 'dead-simple-curry';
function sendEvent(category, action, label) {
ga('send', category, action, label);
}
const sendVideoEvent = curry(sendEvent)('video');
sendVideoEvent('play', 'funny cats');
const playEvent = sendVideoEvent('play');
playEvent('funny cats');
```
Don't forget to take a look at [the specification](https://github.com/msn0/dead-simple-curry/blob/master/test.js).
# Credits
[Currying vs Partial Application](http://www.datchley.name/currying-vs-partial-application/) by Dave Atchley.