Skip to content
Inherit, extend, decorate, and override classes and instances.
JavaScript
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
.editorconfig
.esformatter
.eslintrc
.gitignore
LICENSE
README.md
bower.json
index.js feat(extendable): create base class & extendable mixin
package.json chore(release): 1.0.3

README.md

subclass.js

A small and simple way to inherit, extend, decorate, and override JavaScript classes and instances in an efficient and convenient manner.

Small Size

349 bytes (minified and gzipped).

Simple API

Subclass Extendable to create your first class.

var Car = Extendable.extend(function(options) {
  // ... constructor
}).shared({
  // ... prototype members
}).statics({
  // ... static members
});

Which itself can be subclassed.

var Audi = Car.extend( /* ... */ );
var Toyota = Car.extend( /* ... */ );

And whose subclasses can also be subclassed.

var AudiHatchback = Audi.extend( /* ... */ );
var ToyotaHatchback = Toyota.extend( /* ... */ );
Something went wrong with that request. Please try again.