faster github stars count

This commit is contained in:
Matthias Kretschmann 2020-06-16 16:49:17 +02:00
parent 87971dff2c
commit abc037903c
Signed by: m
GPG Key ID: 606EEEF3C479A91F
1 changed files with 1 additions and 10 deletions

View File

@ -25,16 +25,7 @@ export default async function fetchGitHubRepos() {
}
const json = await response.json()
const numbers = []
json.map((item) => {
if (item.stargazers_count) {
return numbers.push(item.stargazers_count)
}
return null
})
const numbers = json.map((item) => item.stargazers_count)
const stars = arrSum(numbers)
const repositories = json.length