Created
November 7, 2019 20:30
-
-
Save oaugusto256/0f0986cde73c76d74f0a455c006dff74 to your computer and use it in GitHub Desktop.
See all request being made at your React application
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// To see all the requests in the chrome Dev tools in the network tab. | |
XMLHttpRequest = GLOBAL.originalXMLHttpRequest ? | |
GLOBAL.originalXMLHttpRequest : | |
GLOBAL.XMLHttpRequest; | |
// fetch logger | |
global._fetch = fetch; | |
global.fetch = function (uri, options, ...args) { | |
return global._fetch(uri, options, ...args).then((response) => { | |
console.log('Fetch', { request: { uri, options, ...args }, response }); | |
return response; | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment