{"action":"created","issue":{"url":"https://api.github.com/repos/jashkenas/backbone/issues/4039","repository_url":"https://api.github.com/repos/jashkenas/backbone","labels_url":"https://api.github.com/repos/jashkenas/backbone/issues/4039/labels{/name}","comments_url":"https://api.github.com/repos/jashkenas/backbone/issues/4039/comments","events_url":"https://api.github.com/repos/jashkenas/backbone/issues/4039/events","html_url":"https://github.com/jashkenas/backbone/issues/4039","id":158395294,"number":4039,"title":"Add destroy/deconstructor for Backbone.Events","user":{"login":"nmschulte","id":8540239,"avatar_url":"https://avatars.githubusercontent.com/u/8540239?v=3","gravatar_id":"","url":"https://api.github.com/users/nmschulte","html_url":"https://github.com/nmschulte","followers_url":"https://api.github.com/users/nmschulte/followers","following_url":"https://api.github.com/users/nmschulte/following{/other_user}","gists_url":"https://api.github.com/users/nmschulte/gists{/gist_id}","starred_url":"https://api.github.com/users/nmschulte/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nmschulte/subscriptions","organizations_url":"https://api.github.com/users/nmschulte/orgs","repos_url":"https://api.github.com/users/nmschulte/repos","events_url":"https://api.github.com/users/nmschulte/events{/privacy}","received_events_url":"https://api.github.com/users/nmschulte/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-06-03T15:37:36Z","updated_at":"2016-06-03T20:05:58Z","closed_at":null,"body":"Doesn't it make sense to have `Backbone.Events` objects automatically call `off` (with no arguments; to unregister all `once` and `on` handlers) when being destroyed?\r\n\r\nParticularly, this is useful for `Backbone.View` objects (or `Backbone.Model` objects, though I haven't run into a use case for this) that listen to themselves (mainly, when using Marionette's views/trigger methods).\r\n\r\nThis could be done by having the `Backbone.View`'s `destroy` call `off`, but the refactor to give `Backbone.Events` a deconstructor seems a better solution to me.\r\n\r\nFor now, I've been using `listenTo`/`listenToOnce` instead of using `on`/`once` and managing an `off` call."},"comment":{"url":"https://api.github.com/repos/jashkenas/backbone/issues/comments/223680844","html_url":"https://github.com/jashkenas/backbone/issues/4039#issuecomment-223680844","issue_url":"https://api.github.com/repos/jashkenas/backbone/issues/4039","id":223680844,"user":{"login":"paulfalgout","id":2028470,"avatar_url":"https://avatars.githubusercontent.com/u/2028470?v=3","gravatar_id":"","url":"https://api.github.com/users/paulfalgout","html_url":"https://github.com/paulfalgout","followers_url":"https://api.github.com/users/paulfalgout/followers","following_url":"https://api.github.com/users/paulfalgout/following{/other_user}","gists_url":"https://api.github.com/users/paulfalgout/gists{/gist_id}","starred_url":"https://api.github.com/users/paulfalgout/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paulfalgout/subscriptions","organizations_url":"https://api.github.com/users/paulfalgout/orgs","repos_url":"https://api.github.com/users/paulfalgout/repos","events_url":"https://api.github.com/users/paulfalgout/events{/privacy}","received_events_url":"https://api.github.com/users/paulfalgout/received_events","type":"User","site_admin":false},"created_at":"2016-06-03T20:05:58Z","updated_at":"2016-06-03T20:05:58Z","body":"I mean I guess I see what you're saying, but I don't know the purpose of removing listeners on itself.\r\n\r\nThe thing is `this.on` and subsequently `this.listenTo(this` _don't_ need to be cleaned up because they only reference themselves. Once the view is ready for garbage collection, the listeners will go with it.  If you had the need for some other context then you'd be using `listenTo` correct?\r\n\r\nMaybe if there was a more specific example?\r\n\r\nHad to dig back a bit, but this was discussed on Marionette for Controller https://github.com/marionettejs/backbone.marionette/issues/1219"}}
{"actor":{"display_login":"paulfalgout"}}