npm.io
1.0.0 • Published 9 years ago

auto-bind-extend

Licence
MIT
Version
1.0.0
Deps
1
Vulns
0
Weekly
0

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