Skip to content
New issue

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

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

Already on GitHub? # to your account

avoid memory leakage and circular reference #119

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

cyfung1031
Copy link
Contributor

@cyfung1031 cyfung1031 commented Aug 16, 2023

Note: since xhr is set to null in config after xhr.readyState becomes 4, config.xhr will be null in async function inside onResponse.

onResponse: function(response, handler){
     ...
      const config = response.config;
      if(config.xhr.readyState  === XMLHttpRequest.DONE){
           setTimeout(()=>{
               console.log('config.xhr === null', config.xhr===null);
          }, 100)
      }
     ...
     handler.resolve(response);
}

cyfung1031 added a commit to cyfung1031/ajax-hook that referenced this pull request Aug 16, 2023
cyfung1031 added a commit to cyfung1031/ajax-hook that referenced this pull request Aug 16, 2023
cyfung1031 added a commit to cyfung1031/ajax-hook that referenced this pull request Aug 16, 2023
cyfung1031 added a commit to cyfung1031/ajax-hook that referenced this pull request Aug 16, 2023
cyfung1031 added a commit to cyfung1031/ajax-hook that referenced this pull request Aug 16, 2023
@cyfung1031
Copy link
Contributor Author

Combined Distribution Script ajaxhook.js for Testing (PR 119, 120, 121, 122)
https://cdn.jsdelivr.net/gh/cyfung1031/ajax-hook@1ebe48e08108449669290a226e52fc6fbf7ec9ef/dist/ajaxhook.js

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
1 participant