Skip to content

Instantly share code, notes, and snippets.

@sabesansathananthan
Created February 9, 2021 10:52
Show Gist options
  • Save sabesansathananthan/ed1c153a32b439bb9eff8a72b372ffea to your computer and use it in GitHub Desktop.
Save sabesansathananthan/ed1c153a32b439bb9eff8a72b372ffea to your computer and use it in GitHub Desktop.
Axios Vs Fetch
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