itsjoekent-bind
v1.0.1
Published
Bind functions to a scope
Readme
itsjoekent-bind
Automatically bind all functions of a class to itself.
Usage
const bind = require('itsjoekent-bind');
class Example {
constructor() {
this.ref = 'ok';
bind.all(this, Example);
}
howdy(cb) {
return setTimeout(() => cb(this.ref), 0);
}
}
new Example().howdy(console.log); // 'ok'Installation
$ npm install itsjoekent-bindTests
$ npm install
$ npm testApart of itsjoekent/packages
Very opinionated ™️ suite of NPM packages I use to quickly build cool shit. https://github.com/itsjoekent/packages
License
MIT
