Backbone Metal
Classes, Mixins, Errors, and more.
Usage
Classes
Classes are objects that you can instantiate with new Class()
. You can also create a subclass from any existing class by calling its extend()
method.
; const MyClass = Class; let myClass = greeting: 'Hello' subject: 'World';// >> Created! Hello World!
Mixins
When working with multiple classes, sometimes you want to share functionality between them. You can easily do this by creating a new Mixin
and adding it to all the classes that need it.
; const MyMixin = { console; }; const MyClass = Class; MyClass; let myClass = ;// >> Alert! You have successfully used a Mixin!
Super
When working with subclasses, sometimes you want to modify one of the parent's methods and then calling the parent method inside. You can easily do this by calling _super
.
; const FirstClass = Class; const SecondClass = FirstClass; let secondClass = ;// >> First Class checking in!// >> Second Class checking in!
Contributing
Getting Started
git clone git@github.com:marionettejs/backbone-metal.git && cd backbone-metal
Make sure Node.js and npm are installed.
npm install
Running Tests
npm test
===
© 2014 James Kyle. Distributed under ISC license.