Permalink
Browse files

Don't over-promise with your code.

  • Loading branch information...
1 parent 60201a0 commit ea38977e47e60768f430cc5a00758d44cb0d15b6 @philnash committed Feb 12, 2017
Showing with 2 additions and 2 deletions.
  1. +2 −2 _posts/2017-02-09-toast-to-es2015-destructuring.md
@@ -39,10 +39,10 @@ Let's take a look at the code:
const deadPonyClubUrl = "https://api.punkapi.com/v2/beers/91";
const punkAPIPromise = fetch(punkAPIUrl)
.then(res => res.json())
- .then(data => Promise.resolve(data[0]));
+ .then(data => data[0]);
const deadPonyClubPromise = fetch(deadPonyClubUrl)
.then(res => res.json())
- .then(data => Promise.resolve(data[0]));
+ .then(data => data[0]);
Promise.all([punkAPIPromise, deadPonyClubPromise])
.then(beers => {

0 comments on commit ea38977

Please sign in to comment.