1.0.1 • Published 9 years ago

inherit-multiple v1.0.1

Weekly downloads
4
License
ISC
Repository
github
Last release
9 years ago

#Inherit Multiple

Extends a child class by creating a prototype chain out of the base class(es)

view on npm npm module downloads per month Build Status Dependency Status

Usage

Install $ npm install inherit-multiple Test $ npm test Document $ npm run doc

Library

Modules

inherit-multiple

Adds a prototype chain of all the base classes to a child class

inherit-multiple~inheritMultiple

Creates a prototype chain from the super classes for the child class as the prototype of the child class.(childClass, ...superClasses) ⇒ childClass Returns: childClass - Returns the extended child class

ParamTypeDescription
childClassfunctionchild class to extend
...superClassesfunctionsuper classes to extend the child class with

Example

function ChildClass(){}
function SuperClass(){}
SuperClass.prototype.method = function(){};
var inheritMultiple = require('inherit-multiple');
inheritMultiple(ChildClass, SuperClass, Array);
var instance = new ChildClass();