Created
October 26, 2020 20:53
-
-
Save allangrds/8886975de7d7427f29f1b4e4653e5307 to your computer and use it in GitHub Desktop.
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
fetch = (originalFetch => { | |
return (...arguments) => { | |
const result = originalFetch.apply(this, arguments); | |
return result.then(console.log('A requisição foi enviada')); | |
}; | |
})(fetch); | |
fetch('https://api.github.com/orgs/axios') | |
.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