Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow last request to be aborted #84

Merged
merged 1 commit into from Mar 28, 2016
Merged

Conversation

emuvente
Copy link
Contributor

Currently Backbone.Siren does not save a reference to the jqXHR object from the request when it resolves a url. This pull request brings in a way (albeit an ugly way) to save the jqXHR object. This pull request also adds a method to abort the last request, which is only possible once the jqXHR object from the last request is being saved.

@emuvente emuvente assigned emuvente and abhishekbh and unassigned emuvente Mar 28, 2016
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.2%) to 85.809% when pulling 5965b5d on allow-abort-last-request into 8835f0c on master.

@@ -630,8 +630,6 @@ _.extend(BbSiren, {


/**
* @todo is this even being used?
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, in BbSiren.resolveOne

@abhishekbh
Copy link
Contributor

One thing to note is that aborting a jqXHR will result in an error being triggered, so we probably want to handle that gracefully on the client. If you find that to be troublesome to handle, you can call open() on an already opened request and that will abort it as well, but suppress the error.
https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest#open%28%29

@abhishekbh abhishekbh merged commit 74fb205 into master Mar 28, 2016
@abhishekbh
Copy link
Contributor

Leaving branch for you to delete @emuvente since you might want to revisit it.

@emuvente emuvente deleted the allow-abort-last-request branch March 28, 2016 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants