auto-bind-extend
v1.0.0
Published
extendable class for binding functions
Downloads
1
Readme
auto-bind-extend
a simple class that can be used to put your function context troubles to rest. Based on auto-bind
example
const BaseAutoBind = require('auto-bind-extend');
class Cool extends BaseAutoBind {
constructor() {
super();
this.name = 'Cool';
}
say() {
return this.name;
}
}
let cool = new Cool();
// No matter where this function may travel, it'll stay cool
let coolSayFn = cool.say;
console.log(coolSayFn()); // Cool!
dev
npm test
npm run coverage