I've not had a chance to listen to the episode yet. Any Chance you can explain this one? Thought I had started to understand async/ await until I saw this! Thanks.
Let me break that up.
const response = await fetch('https://api.github.com/users/wesbos'); const data = await response.json(); //this gives us the JSON data from the response.
Previously it used to be,
fetch('https://api.github.com/users/wesbos') .then(res => res.json()) //json() also returns a promise .then(data => {console.log(data)});
Ahhh I see, that's amazing thanks for that! <3
Thanks! I just clarified this in a tweet:
twitter.com/wesbos/status/95583181...
Thanks Wes, keep up the good work! Loving them tasty treats :P
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I've not had a chance to listen to the episode yet. Any Chance you can explain this one? Thought I had started to understand async/ await until I saw this! Thanks.
Let me break that up.
Previously it used to be,
Ahhh I see, that's amazing thanks for that! <3
Thanks! I just clarified this in a tweet:
twitter.com/wesbos/status/95583181...
Thanks Wes, keep up the good work! Loving them tasty treats :P