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

Request Object not available from response #39

Closed tremendus closed 1 year ago

tremendus commented 7 years ago

Hi, great library, my favorite Ajax lib actually ...

I see from the docs and the source that there is no obvious way to get to the request object from the response. In my case, I would like to have an emitter called in the on('end') callback that emits the url, status code and the method for logging purposes. But doesn't seem currently possible.

Happy to do a PR - where do you suggest to do this in source?

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/46657109-request-object-not-available-from-response?utm_campaign=plugin&utm_content=tracker%2F6332594&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F6332594&utm_medium=issues&utm_source=github).
krampstudio commented 7 years ago

Glad you like it! The simplest would be to add the request object as last parameter of all those trigger calls here

That's not the most elegant way but it should work and won't break compatibility.

If you have time to create a PR, that would be awesome.