0.1.0 • Published 9 years ago

fetch-functions v0.1.0

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

fetch-functions

Fetches a list of specified functions from an object leaving the objects context.

Dependency Status Build Status npm version

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