inherit-multiple
v1.0.1
Published
Multiple inheritence
Downloads
30
Maintainers
Readme
#Inherit Multiple Extends a child class by creating a prototype chain out of the base class(es)
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
| Param | Type | Description | | --- | --- | --- | | childClass | function | child class to extend | | ...superClasses | function | super 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();