Hey there!
I'm using aja.js as a jQuery's $.ajax replacement on a Backbone-based project. One of my use cases is having an XHR requests auto-retry mechanism (that is, basically: abort&retry the very same call, and then, if there's no response again, let it fail). To do so, I had to tweak aja.js in order not to build another layer on top of it, or even worse, switch to a different library.
I've used the good ol' setTimeout for practical reasons, as I've found pretty damn hard to unit test the feature using the XHR's native timeout/ontimeout.
If you spot anything weird we can discuss about it, I'm open to suggestions of course :)
Cheers!
Hey there! I'm using aja.js as a jQuery's $.ajax replacement on a Backbone-based project. One of my use cases is having an XHR requests auto-retry mechanism (that is, basically: abort&retry the very same call, and then, if there's no response again, let it fail). To do so, I had to tweak aja.js in order not to build another layer on top of it, or even worse, switch to a different library. I've used the good ol' setTimeout for practical reasons, as I've found pretty damn hard to unit test the feature using the XHR's native timeout/ontimeout. If you spot anything weird we can discuss about it, I'm open to suggestions of course :) Cheers!