bind-all-component

Component for creating singletons from objects

bind-all

Component for creating singletons from objects

$ component install segmentio/bind-all
 
function User () {
  this.x = 4;
}
 
User.prototype.y = function () {
  return this.x;
};
 
 
var user = bindAll(new User());
 
user.y.apply(this); // 4 
 

MIT