Home

Awesome

bind-arguments npmjs.com The MIT License

Bind context (optional) and multiple arguments to function.

code climate standard code style travis build status coverage status dependency status

Install

npm i bind-arguments --save

Usage

For more use-cases see the tests

Params

Example

var bindArguments = require('bind-arguments')

var args = ['foo', 'bar']
var ctx = {qux: 'baz'}
var boundFn = bindArguments(function (a, b, c) {
  return [a, b, c, this.qux]
}, args, ctx)
boundFn() //=> ['foo', 'bar', undefined, 'baz']

var boundFn2 = bindArguments.call({qux: 'roo'}, function (a, b) {
  return [a, b, this.qux]
}, args)
boundFn2() //=> ['foo', 'bar', 'roo']

Related

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
But before doing anything, please read the CONTRIBUTING.md guidelines.

Charlike Make Reagent new message to charlike freenode #charlike

tunnckocore.tk keybase tunnckocore tunnckoCore npm tunnckoCore twitter tunnckoCore github