This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var AwesomeObject = function() { | |
this.init() | |
}; | |
AwesomeObject.prototype = { | |
init: function() { | |
_.bindAll(this, 'onSuccess', 'onError', 'onComplete') | |
// or | |
this.onSuccess = $.proxy(this.onSuccess, this) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*! (c) 2016 Andrea Giammarchi - MIT Style License */ | |
// simple state-like objects handler | |
// based on prototypal inheritance | |
function State() {'use strict';} | |
// States are serializable dictionaries | |
// toJSON and toString are the only reserved keywords | |
// every other name can be used as name (included __proto__) |