From bfafe52f205af275c6b61ae719fa4a18bdfa8033 Mon Sep 17 00:00:00 2001 From: Diogo Soares Date: Thu, 17 Aug 2023 16:59:32 +0200 Subject: [PATCH] use Promise.all --- src/pages/index.tsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/pages/index.tsx b/src/pages/index.tsx index a44b0b96..00fc5c91 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -8,10 +8,12 @@ const IndexPage: NextPage> = (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: {