inherit-multiple

1.0.1 • Public • Published

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

ModuleDescription
inherit-multiple

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

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();

/inherit-multiple/

    Package Sidebar

    Install

    npm i inherit-multiple

    Weekly Downloads

    2

    Version

    1.0.1

    License

    ISC

    Last publish

    Collaborators

    • jhorlin