0.1.0 • Published 9 years ago

bind-handler v0.1.0

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

bind-handler

NPM version Build Status Test coverage Dependency Status

Bind event handlers to this less verbose

Install

$ npm install bind-handler

Usage

var bindHandler = require('bind-handler');

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

  handleClick() {
	// handler-prefix methods will be auto bound to this
	// Just like this.handleClick = this.handleClick.bind(this)
  }

  otherClick() {
	// other methods will not be auto bound to this
  }
}
//=>

License

MIT © C.T. Lin