Parallelise all requests

This commit is contained in:
Rūdolfs Ošiņš
2024-11-01 11:43:45 +01:00
parent ba0293324a
commit 3df2d3ec14
2 changed files with 65 additions and 53 deletions
+4 -2
View File
@@ -50,8 +50,10 @@ export async function loadRoute(
_previousLoaded: LoadedRoute,
): Promise<LoadedRoute> {
if (route.resource === "home") {
const repos: RepoInfo[] = await invoke("list_repos");
const config: Config = await invoke("config");
const [config, repos] = await Promise.all([
invoke<Config>("config"),
invoke<RepoInfo[]>("list_repos"),
]);
return { resource: "home", params: { repos, config } };
} else if (route.resource === "repo.issue") {
return loadIssue(route);