Skip to content

Instantly share code, notes, and snippets.

@tgriesser
Created December 7, 2012 15:41
Show Gist options
  • Save tgriesser/4234038 to your computer and use it in GitHub Desktop.
Save tgriesser/4234038 to your computer and use it in GitHub Desktop.
var YourModel = Backbone.Collection.extend({
beforeDestroy:function () {
if (/*someLogic*/) {
this.destroy();
}
},
})
var YourCollection = Backbone.Collection.extend({
model: YourModel,
initialize: function () {
this.on('destroy', function (model) {
// after destroy
});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment