This package has been deprecated

Author message:

Use ES classes

kist-klass

0.1.6 • Public • Published

kist-klass

Simple class system. Inspired by Backbone extend and simple inheritance by John Resig.

Installation

npm install kist-klass --save
 
bower install kist-klass --save

API

.extend([options])

Returns: Klass

Extend base (or already extended class).

If you provide constructor method, it will override default constructor.

._super

Type: Function

Current class parent.

Examples

var Klass = require('kist-klass');
 
var Foo = Klass.extend({
    props: {
        foo: 1
    }
});
 
var Bar = Foo.extend({
    constructor: function () {
        // Constructor logic
        Bar._super.constructor.apply(this, arguments);
    }
    props: {
        bar: 2
    }
});
 
var foo = new Foo();
var bar = new Bar();

AMD and global

define(['kist-klass'], cb);
 
window.kist.klass;

Browser support

Tested in IE8+ and all modern browsers.

License

MIT © Ivan Nikolić

Readme

Keywords

Package Sidebar

Install

npm i kist-klass

Weekly Downloads

37

Version

0.1.6

License

MIT

Last publish

Collaborators

  • niksy