Skip to content

Instantly share code, notes, and snippets.

@esamattis
Last active June 7, 2019 10:31
Show Gist options
  • Save esamattis/0b27087cf903c6cc27a6306ed04361f9 to your computer and use it in GitHub Desktop.
Save esamattis/0b27087cf903c6cc27a6306ed04361f9 to your computer and use it in GitHub Desktop.
async function fetchUser(username) {
const [user, orgs, repos, starred] = await Promise.all([
fetch(`${api}/users/${username}`),
fetch(`${api}/users/${username}/orgs`),
fetch(`${api}/users/${username}/repos`),
fetch(`${api}/users/${username}/starred`),
].map(p => p.then(r => r.json())));
return {user, orgs, repos, starred};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment