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

Store jqXHR in promise object. #8145

Merged
merged 1 commit into from Mar 22, 2021
Merged

Store jqXHR in promise object. #8145

merged 1 commit into from Mar 22, 2021

Conversation

maliming
Copy link
Member

@maliming maliming commented Mar 19, 2021

Resolve #8139

var req = abp.ajax({
  type: 'GET',
  url: '/api/identity/users'
});

req.then(function(result){
  console.log(result);
});

req.jqXHR.abort();

req.then() will create a new Deferred which will lost jqXHR. Must be saving return value first.

var req = abp.ajax({
  type: 'GET',
  url: '/api/identity/users'
}).then(function(result){
  console.log(result);
});

//Not working.
req.jqXHR.abort();

image

@maliming maliming added this to the 4.3-preview milestone Mar 19, 2021
@maliming maliming requested a review from hikalkan March 19, 2021 15:00
@hikalkan hikalkan merged commit b591816 into dev Mar 22, 2021
@hikalkan hikalkan deleted the maliming/jqXHR branch March 22, 2021 11:46
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.

The request created by abp.ajax can't be aborted.
2 participants