Skip to content

Instantly share code, notes, and snippets.

@slorber
Created July 10, 2014 13:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save slorber/62ecdcc7a3f70733f1a4 to your computer and use it in GitHub Desktop.
Save slorber/62ecdcc7a3f70733f1a4 to your computer and use it in GitHub Desktop.
var AppState = function() { };
AppState.prototype = {
updateAppState: function(updateFunction) {
console.debug("before updating:",this);
console.debug("before updating:",this.prototype.constructor);
console.debug("before updating:",this.constructor);
console.debug("before updating:",new this.constructor());
console.debug("before updating:",new this.prototype.constructor());
Preconditions.checkMandatoryParameter(updateFunction,"updateFunction is required");
var updated = React.addons.update(this, updateFunction);
//DeepFreeze(updated);
return updated;
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment