Skip to content

Coding-With-Kristi/fetch-API-interceptors

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation


JavaScript HTML

Add Interceptors to Browser FETCH API

By default Fetch API does not offer support for interceptors, but you can monkey patch it. Monkey patching is an approach that overrides the original functionality with your version of the function

const originalFetch = window.fetch;

window.fetch = function(url, options) {
    // Your code goes here...

    return originalFetch(url, options);
  };

Checkout the index.html file on how to add interceptors to Fetch API

Releases

No releases published

Packages

No packages published

Languages