simpler-extend
Simple 'extend' helper for inheritance and subclassing. Adapted from Backbone.js's Model.extend and CoffeeScript. This works like simple-extend, except this does not have any dependencies.
Usage
Assign it to your base class's .extend
:
{ ... }Shapeextend = ;
Then use it to subclass:
var Circle = Shape;
You can also add a constructor as constructor
:
var Circle = Shape;
Calling methods from the base class:
var Circle = Shape;
See Backbone.js's Model.extend documentation for more details.
Thanks
simpler-extend © 2015+, Rico Sta. Cruz. Released under the MIT License.
Authored and maintained by Rico Sta. Cruz with help from contributors (list).
ricostacruz.com · GitHub @rstacruz · Twitter @rstacruz