bond-args
v1.1.0
Published
A funner Function.prototype.bind
Downloads
5
Maintainers
Readme
Bond Args
Like Function.prototype.bind, but funner and more flexible partial argument application.
- Supports partial argument application: Yes.
- Supports context/this binding: Yes.
Installation
$ npm install bond
Usage
const bond = require('bond-args');
const y = ({ m, x }, b) => m*x + b;
const oneArg = bond(y, null, undefined, 3);
const twoArgs = bond(oneArg, null, { x: 2 });
expect(twoArgs({ m: 1 })).toBe(5); // true