bind-all
Create singletons from objects.
Installation
$ npm install bind-allAPI
function User() {
this.x = 4;
}
User.prototype.y = function y() {
return this.x;
};
var user = bindAll(new User());
user.y.apply(this); // 4Create singletons from objects.
$ npm install bind-allfunction User() {
this.x = 4;
}
User.prototype.y = function y() {
return this.x;
};
var user = bindAll(new User());
user.y.apply(this); // 4