1.0.0 • Published 7 years ago

bindself v1.0.0

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

bindself

Binds all class methods to object.

Usage

const bindself = require('bindself');

class A {
  constructor() {
    bindself(this);
  }

  something() {
    // do something with this
  }
}

const a = new A();

// now a.something() is bound to a