Skip to content

Instantly share code, notes, and snippets.

@sdesai
Created August 7, 2012 23:52
Show Gist options
  • Save sdesai/3290656 to your computer and use it in GitHub Desktop.
Save sdesai/3290656 to your computer and use it in GitHub Desktop.
var MS = function(config) {
/* Whatever constructor stuff you wanted.
No point chaining, since there's no inheritance,
and Y.ModelSync.REST's constructor and initializer
will get called by the infrastructure
*/
};
...
MS.prototype.getURL : function (action, options) {
if (Lang.isArray(this._shelves)) {
return this.root;
}
// other conditions here
return Y.ModelSync.REST.prototype.getURL.apply(this, arguments);
};
MS.prototype.sync = function() {
if (someoverridecondition) {
// new logic
} else {
Y.ModelSync.REST.prototype.sync.apply(this, arguments);
}
};
Y.GalleryModelSync = MS;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment