Created
December 18, 2017 15:04
-
-
Save diego3g/2081d1a1038489e3c4006c16bf10685e 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
// Modelo antigo (ES6) | |
function fetchUser(user) { | |
api.get(`/users/${user}`).then(response => { | |
console.log(response); | |
}); | |
} | |
// Novo modelo (ES8) | |
async function fetchUser(user) { | |
const response = await api.get(`/users/${user}`); | |
console.log(response); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment