https://github.com/hermanya/partial-application-with-named-parameters
🍛 Bind (curry) with options object
https://github.com/hermanya/partial-application-with-named-parameters
bind curry javascript named-parameters parameters partial-functions
Last synced: 8 months ago
JSON representation
🍛 Bind (curry) with options object
- Host: GitHub
- URL: https://github.com/hermanya/partial-application-with-named-parameters
- Owner: Hermanya
- License: mit
- Created: 2016-04-26T03:19:05.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2018-02-02T16:57:14.000Z (over 7 years ago)
- Last Synced: 2024-12-28T03:42:13.386Z (9 months ago)
- Topics: bind, curry, javascript, named-parameters, parameters, partial-functions
- Language: JavaScript
- Homepage: https://github.com/Hermanya/partial-application-with-named-parameters/blob/master/test.js
- Size: 41 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# [Partial Application](https://github.com/MostlyAdequate/mostly-adequate-guide/blob/master/ch4.md) with Named Parameters [](https://travis-ci.org/Hermanya/partial-application-with-named-parameters)

## Usage
First have a function, that destructs its first and only parameter.
This module will make you able to partially apply named parameters for that function.
[Take a look at tests](test.js) to for details.```js
import test from 'ava';
import bindable from './';test('calculate sum', t => {
const reduce = bindable(function ({reducer, initialValue, array}) {
return array.reduce(reducer, initialValue);
});
const reduceFromZero = reduce({initialValue: 0});
const array = [1, 2, 3];t.is(reduceFromZero({
reducer: (x, y) => x + y,
array
}), 6);
});
```## License
MIT © [Herman Starikov](http://hermanya.github.io)