Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A base javascript class that allows for easy inheritance
JavaScript
tag: 0.0.1

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
dist
lib
test
.gitignore
package.json
readme.md

readme.md

Thrive

Thrive is a utility class that provides out of the box inheritance, proxy/curry for event scope, and easily passing in params.

Example

var SomeClass = Thrive.extend({
    init: function() {
        console.log(this.debug); //true
    },
    setDebug: function(debug) {
        this.debug = debug;
    }
});

var someClass = new SomeClass({ debug: true });
someclass.setDebug(true);

Inheritance

var AnotherClass = SomeClass.extend({
    setDebug: function(debug) {
        SomeClass.prototype.setDebug.call(this, debug);
        //do something else
    }
});
var anotherClass = new AnotherClass({ debug: false });
anotherClass.setDebug(true);

Proxy/Curry

var SomeClass = Thrive.extend({
    init: function() {
        setTimeout(this.proxy(this.method, '123'), 100);
    },
    method: function(arg) {
        console.log(arg); //123
    }
});

Install

Node.js: npm install thrive

Something went wrong with that request. Please try again.