0.0.7 • Published 9 years ago

kaaa-class v0.0.7

Weekly downloads
22
License
-
Repository
-
Last release
9 years ago

Kaaa Class

A easy class systeme. Inheritence, Supers, Eventing

Installation

  • npm install kaa-class

Example

var Class = require('./kaaa-class');

var a = Class.extend({
  init:function(){
    console.log("coucou");
  }
});

var c = a.extend({
  word:"what",
  init:function () {
    this._super();
    console.log("hey");
    this.on('coucou', this.say.bind(this));
  },
  say:function () {
    console.log(this.word);
  },
});

var h = c.extend({
  word:"ok",
  init:function () {
    this._super();
    console.log("super");
  }
});

var b = new h({word:"nice"});
b.trigger("coucou");

// logs :
// >> coucou
// >> hey
// >> super
// >> nice
0.0.7

9 years ago

0.0.6

9 years ago

0.0.5

9 years ago

0.0.4

9 years ago

0.0.3

9 years ago

0.0.2

9 years ago

0.0.1

9 years ago