bind-to
Bind all methods in an object to a specified context and arguments
Install
$ npm install --save bind-to
Usage
var bind = var object = { return thisbar }var context = bar: 'baz'object // => 'baz'
API
bind(object, context, args...)
-> object
Returns the original object for convenience.
object
Required
Type: object
The object to bind.
context
Required
Type: any
The this
value to bind to.
args...
Variadic arguments to apply to the methods.
License
MIT © Ben Drucker