1.1.0 • Published 6 years ago

bond-args v1.1.0

Weekly downloads
4
License
MIT
Repository
github
Last release
6 years ago

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