bond-args

1.1.0 • Public • Published

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*+ b;
const oneArg = bond(y, null, undefined, 3);
const twoArgs = bond(oneArg, null, { x: 2 });
 
expect(twoArgs({ m: 1 })).toBe(5); // true

Package Sidebar

Install

npm i bond-args

Weekly Downloads

1

Version

1.1.0

License

MIT

Last publish

Collaborators

  • zacharyrsmith