Created
January 12, 2015 22:34
-
-
Save vinnymac/fa9a07324f8649f7c1d4 to your computer and use it in GitHub Desktop.
Just some JS about destroying and stuff
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
// 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