Skip to content

Commit

Permalink
chore(app): remove unused promise all
Browse files Browse the repository at this point in the history
  • Loading branch information
matschik committed Oct 28, 2024
1 parent 4e046fa commit 30cb571
Showing 1 changed file with 18 additions and 20 deletions.
38 changes: 18 additions & 20 deletions src/Index.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -171,26 +171,24 @@
let snippetsByFrameworkIdLoading = $state(new SvelteSet());
let snippetsByFrameworkIdError = $state(new SvelteSet());
$effect(async () => {
Promise.all(
[...frameworkIdsSelected].map(async (frameworkId) => {
if (!snippetsByFrameworkId.has(frameworkId)) {
snippetsByFrameworkIdError.delete(frameworkId);
snippetsByFrameworkIdLoading.add(frameworkId);
await snippetsImporterByFrameworkId[frameworkId]()
.then(({ default: frameworkSnippets }) => {
snippetsByFrameworkId.set(frameworkId, frameworkSnippets);
})
.catch(() => {
snippetsByFrameworkIdError.add(frameworkId);
})
.finally(() => {
snippetsByFrameworkIdLoading.delete(frameworkId);
});
}
})
);
$effect(() => {
[...frameworkIdsSelected].map((frameworkId) => {
if (!snippetsByFrameworkId.has(frameworkId)) {
snippetsByFrameworkIdError.delete(frameworkId);
snippetsByFrameworkIdLoading.add(frameworkId);
snippetsImporterByFrameworkId[frameworkId]()
.then(({ default: frameworkSnippets }) => {
snippetsByFrameworkId.set(frameworkId, frameworkSnippets);
})
.catch(() => {
snippetsByFrameworkIdError.add(frameworkId);
})
.finally(() => {
snippetsByFrameworkIdLoading.delete(frameworkId);
});
}
});
});
let showBonusFrameworks = $state(false);
Expand Down

0 comments on commit 30cb571

Please sign in to comment.