Skip to content

zkochan/fetch-functions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published