Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
tracker1
6 months ago
|
parent
|
context
|
favorite
| on:
Modern Node.js Patterns
It isn't, the following works fine...
var data = await fetch(url).then(r => r.json());
Understanding Promises/A (thenables) and async/await can sometimes be difficult or confusing, especially when mixing the two like above.
mcv
6 months ago
[–]
Same thing. Maybe this doesn't make the double promise quite as visible, but it's still a double promise. You could probably replace the other await with a .then() too.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: