extensible constructors.
Install with component(1):
$ component install yields/extensible
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);
Add recursive .extend(Other)
method to Constructor
.
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.
MIT