Skip to content

Instantly share code, notes, and snippets.

@vinnymac
Created January 12, 2015 22:34
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 vinnymac/fa9a07324f8649f7c1d4 to your computer and use it in GitHub Desktop.
Save vinnymac/fa9a07324f8649f7c1d4 to your computer and use it in GitHub Desktop.
Just some JS about destroying and stuff
// somewhere else in time and space
SomeView = new Backbone.Marionette.View.extend({
onDestroy: function(){
App.vent.trigger('define:var:to:block:callback');
}
});
// some other view
MyView = new Backbone.Marionette.View.extend({
initialize: function(){
this.listenTo(App.vent, 'define:var:to:block:callback', this.defineVar);
},
defineVar: function(){
this.stopWhatYouAreAboutToDo = true
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment