@nathanfaucett/bind

0.0.1 • Public • Published

bind

binds object to functions this value

var bind = require("@nathanfaucett/bind");


var counter = {
    value: 0
};

var inc = bind(function inc() {
    this.value++;
}, counter);


inc();

// counter.value === 1

Readme

Keywords

Package Sidebar

Install

npm i @nathanfaucett/bind

Weekly Downloads

1

Version

0.0.1

License

MIT

Last publish

Collaborators

  • nathanfaucett