Quantcast
Channel: JavaScriptMVC Forum
Viewing all articles
Browse latest Browse all 3491

Clean up on control/view removal

$
0
0
I have a control that does a lot of requests to the server, when the view is removed from the DOM I want that control to stop doing work. Please see example at http://jsbin.com/otofusimE/5/edit

On my example click on button 'A' and 'B' several times, you will see how I end up with lots of zombie requests.

What is the best way to approach this? Can I listen to when a view is removed? Do I need to call control.destroy() manually?

Thanks,
Sebastian



Viewing all articles
Browse latest Browse all 3491

Trending Articles