Skip to content

Commit

Permalink
use Promise.all
Browse files Browse the repository at this point in the history
  • Loading branch information
DiogoSoaress committed Aug 17, 2023
1 parent fb6c8db commit bfafe52
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ const IndexPage: NextPage<InferGetStaticPropsType<typeof getStaticProps>> = (pro
}

export async function getStaticProps() {
const chainsData = await loadChainsData()
const totalTransactions = await fetchTotalTransactions()
const totalAssets = await fetchTotalAssets()
const totalSafesDeployed = await fetchTotalSafesDeployed()
const [chainsData, totalTransactions, totalAssets, totalSafesDeployed] = await Promise.all([
loadChainsData(),
fetchTotalTransactions(),
fetchTotalAssets(),
fetchTotalSafesDeployed(),
])

return {
props: {
Expand Down

0 comments on commit bfafe52

Please sign in to comment.