Closed anandvenkat4 closed 4 years ago
Looks good to me! A little nitpick, - it's hard to read, we could refactor it into:
const fetchProfile = fetch('https://api.github.com/user', ...);
const fetchEmail = fetch('https://api.github.com/user/emails', ...);
Promise.all([fetchProfile, fetchEmail])
.then([profile, emails] => {
const email = emails[0];
profile.email = email;
return profile;
})
Looks good to me! A little nitpick, - it's hard to read, we could refactor it into:
const fetchProfile = fetch('https://api.github.com/user', ...); const fetchEmail = fetch('https://api.github.com/user/emails', ...); Promise.all([fetchProfile, fetchEmail]) .then([profile, emails] => { const email = emails[0]; profile.email = email; return profile; })
Should I go ahead and make the changes?
Perfect, merging 💟
Fixed the email update.