https://github.com/g-harel/slurry
automagically curry function arguments
https://github.com/g-harel/slurry
apply chain curry functional
Last synced: about 1 month ago
JSON representation
automagically curry function arguments
- Host: GitHub
- URL: https://github.com/g-harel/slurry
- Owner: g-harel
- License: mit
- Created: 2018-03-01T06:27:41.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2021-08-28T22:17:30.000Z (about 4 years ago)
- Last Synced: 2025-10-08T23:11:58.044Z (about 1 month ago)
- Topics: apply, chain, curry, functional
- Language: JavaScript
- Homepage:
- Size: 5.86 KB
- Stars: 6
- Watchers: 0
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

# slurry [](https://github.com/prettier/prettier)
> automagically curry function arguments
Slurrified functions can be chain-called indefinitely to accumulate the passed arguments.
Calling with no arguments ends the chain, runs the initial function with all the arguments and returns the result.
## Install
```shell
$ npm install slurry
```
## Usage
```javascript
const func = (...args) => args;
const s = slurry(func);
s(0)(1)(2)(); //=> [0 1 2]
s(0, 1, 2)(); //=> [0 1 2]
s(0, 1)(2)(); //=> [0 1 2]
let s1 = s(1);
let s2 = s1(2);
let s3 = s1(3);
s2(); //=> [1, 2]
s3(); //=> [1, 3]
```