Use Promise.all

This commit is contained in:
abefernan
2023-04-24 22:23:51 +02:00
parent a8d40ff01f
commit cbc1f7b293
+4 -2
View File
@@ -67,8 +67,10 @@ const ChainSelect = () => {
const getGhJson = useCallback(async () => {
// getting chain info from this repo: https://github.com/cosmos/chain-registry
try {
const { data: chains } = await axios.get(chainsUrl);
const { data: testnets } = await axios.get(testnetsUrl);
const [{ data: chains }, { data: testnets }] = await Promise.all([
axios.get(chainsUrl),
axios.get(testnetsUrl),
]);
const allChains: GithubChainRegistryItem[] = [...chains, ...testnets].filter(
(item: GithubChainRegistryItem) => {