0.1.0 • Published 8 years ago

bind.methods v0.1.0

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

bind.methods

Readme

Bind selected class methods from constructor

Usage

const bind = bindMethods('bind.methods');

class Example {
  constructor() {
    bind(this, 'onClick');
    // bind(this, ['onDragStart', 'onDragEnd']);
    // bind(this); // bind all class methods
  }
  onClick() {
    console.log(this);
  }
}

const example = new Example();

example.onClick.call(123456); // class Example

License

Library bind.methods is licensed under MIT.

0.1.0

8 years ago

0.0.0

8 years ago