Last active
December 16, 2015 02:48
-
-
Save meleyal/5364759 to your computer and use it in GitHub Desktop.
Test Backbone views for memory leaks
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
window.installTest = -> | |
views = [] | |
viewClass = app.NotificationsView | |
options = { collection: new Backbone.Collection } | |
views.push(new viewClass(options)) for i in [0...500] | |
view.remove() for view in views | |
views = [] | |
console.log "#{viewClass.name} installed and removed x #{i}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment