auto-bind-extend

1.0.0 • Public • Published

auto-bind-extend

codecov.io Build Status

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

Readme

Keywords

none

Package Sidebar

Install

npm i auto-bind-extend

Weekly Downloads

1

Version

1.0.0

License

MIT

Last publish

Collaborators

  • dmamills