Skip to content
This repository has been archived by the owner on Apr 4, 2019. It is now read-only.

yields/extensible

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

extensible

extensible constructors.

Installation

Install with component(1):

$ component install yields/extensible

Example

function View(){}
function FormView(){}
function TabView(){}
function ComplexFormView(){}

// => Make the view extensible

extensible(View);

// => FormView extends View

View.extend(FormView);

// => ComplexFormView extends FormView

FormView.extend(ComplexFormView);

API

extensible(Constructor)

Add recursive .extend(Other) method to Constructor.

component/inherit

extensible uses component/inherit to do the inheritance, but it's different from inherit since it adds .extend() static method to your constructor.

this means you can have a single extensible(View) and do View.extend(OtherView) instead of installing component/inherit on each view component.

License

MIT

About

extensible constructors

Resources

Stars

Watchers

Forks

Packages

No packages published