krampstudio / aja.js

Ajax without XML : Asynchronous JavaScript and JavaScript/JSON(P)
http://krampstudio.github.io/aja.js/
MIT License
306 stars 45 forks source link

.timeout() feature #14

Closed jsDotCr closed 9 years ago

jsDotCr commented 9 years ago

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!

krampstudio commented 9 years ago

Cool, I'll have a look!