Created
February 9, 2021 10:52
-
-
Save sabesansathananthan/ed1c153a32b439bb9eff8a72b372ffea to your computer and use it in GitHub Desktop.
Axios Vs Fetch
This file contains hidden or 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
fetch = (originalFetch => { | |
return (...arguments) => { | |
const result = originalFetch.apply(this, arguments); | |
return result.then(console.log('Request was sent')); | |
}; | |
})(fetch); | |
fetch('url') | |
.then(response => response.json()) | |
.then(data => { | |
console.log(data) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment