Fetches a list of specified functions from an object leaving the objects context.
npm install --save fetch-functions
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!` */
MIT