0.1.0 • Published 9 years ago
fetch-functions v0.1.0
fetch-functions
Fetches a list of specified functions from an object leaving the objects context.
Installation
npm install --save fetch-functions
Usage
var fetch = require('fetch-functions');
function HelloWorld() {
this._msg = 'Hello world!';
}
HelloWorld.prototype.log = function() {
console.log(this._msg);
};
HelloWorld.prototype.info = function() {
console.info(this._msg);
};
HelloWorld.prototype.error = function() {
console.error(this._msg);
}
var helloWorld = new HelloWorld();
var dummy = fetch(helloWorld, ['log']);
dummy.log(); /* This will log `Hello world!` */
License
MIT
0.1.0
9 years ago