4 ms·
Those were added in 0.9.9, and yes -- they might be useful. If your app tends to have views and models be created and destroyed together on the same cycle, then
by jashkenas 14y ago
Those were added in 0.9.9, and yes -- they might be useful. If your app tends to have views and models be created and destroyed together on the same cycle, then you don't need to ever `stopListening`. Garbage collection just works as it should.
The new-ish methods are handy when your models live longer then your views do. Because this inversion tracks the listeners on the object that's listening to events, instead of the object that's emitting them, it makes it easier to unbind all of the things a view is listening to, when you want to remove just that view. To that end, `view.remove()` stops listening automatically.