I have a backbone application that has a number of views. Switching between views triggers Ajax requests to get different collections. I would like to stop the current “read” ajax request if a new one is started. Is it possible?
I have a backbone application that has a number of views. Switching between views
Share
Ok so here is what I did
I am saving the the fetch requests in a variable
In my router, I have a function that takes care of closing the views and rendering views. It also takes care of triggering any triggers needed for each view change but that is not relevant in this question.
Before doing anything, this router function executes the following
I hope this helps