Skip to content

pisse/PIS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Welcome to PIS's tool garden.

Here is my implement of some frontend wheel mentioned in 前端开发中有什么经典的轮子值得自己去实现一遍


Class

Another JavaScript Class factory —compared to Prototype, MooTools or Base2.

Example

var A = Class({
    constructor: function(name) {
        this._name = name
    },
    getName: function() {
        return this._name
    },
    toString: function() {
        return this.getName()
    }
})
var B = Class.extend(A)({
    constructor: function($super, name, desc) {
        $super(name)
        this._desc = desc
    },
    getDesc: function() {
        return this._desc
    },
    toString: function($super) {
        return $super() + ': ' + this.getDesc()
    }
})
var C = Class.extend(B)({
    getName: function($super) {
        return '[' + $super() + ']'
    }
})

About

NO PAINS NO GAINS!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published