Package Exports
- classx
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (classx) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
ClassX
Basic module that provide Backbone like extend and _super functionality.
- extend - you can extend any of your class
- _super - easy invoke parent's methods
- mixins - create mixins and mix it into any of ur class (In progress)
##Usage
/**
* @class Note
* @extends ClassX
*/
var Note = ClassX.extend({
/**
* @private
*/
_defineProperties: function () {
this._super();
/**
* @type {Date}
* @private
*/
this._dateCreation = this._options.dateCreation || new Date();
},
/**
* @constructor
* @protected
*/
_initialize: function() {
this._super();
console.log('This note was created ' + this._dateCreation.getTime());
}
});
/**
* @class PrivateNote
* @extends Note
*/
var PrivateNote = Note.extend({
/**
* @constructor
* @protected
*/
_initialize: function() {
this._super();
console.log('No one can see this.');
}
});
var note = new Note({dateCreation: new Date(1991)}); // This note was created ...
var secretNote = new PrivateNote(); // This note was created ... No one can see this.
##Install
npm install objectx##Run tests
mocha --reporter spec