Real-time dashboard for monitoring global news, markets, and geopolitical events
TypeScript
Refactor: Use allNewsItems store instead of local derivation
Reggie6c51efdf1f4f
diff --git a/src/routes/+page.svelte b/src/routes/+page.svelteindex f5f44a9..f14ad8d 100644--- a/src/routes/+page.svelte+++ b/src/routes/+page.svelte@@ -22,19 +22,7 @@WorldLeadersPanel,PrinterPanel} from '$lib/components/panels';- import {- news,- politicsNews,- techNews,- financeNews,- govNews,- aiNews,- intelNews,- markets,- monitors,- settings,- refresh- } from '$lib/stores';+ import { news, markets, monitors, settings, refresh, allNewsItems } from '$lib/stores';import {fetchAllNews,fetchAllMarkets,@@ -62,16 +50,6 @@let leaders = $state<WorldLeader[]>([]);let leadersLoading = $state(false);- // Derived data for panels that need aggregated news- const allNewsItems = $derived([- ...$politicsNews.items,- ...$techNews.items,- ...$financeNews.items,- ...$govNews.items,- ...$aiNews.items,- ...$intelNews.items- ]);-// Data fetchingasync function loadNews() {// Set loading for all categories@@ -280,13 +258,13 @@{#if isPanelVisible('correlation')}<div class="panel-slot">- <CorrelationPanel news={allNewsItems} />+ <CorrelationPanel news={$allNewsItems} /></div>{/if}{#if isPanelVisible('narrative')}<div class="panel-slot">- <NarrativePanel news={allNewsItems} />+ <NarrativePanel news={$allNewsItems} /></div>{/if}@@ -314,7 +292,7 @@subtitle: 'Humanitarian crisis monitoring',criticalKeywords: ['maduro', 'caracas', 'venezuela', 'guaido']}}- news={allNewsItems.filter(+ news={$allNewsItems.filter((n) =>n.title.toLowerCase().includes('venezuela') ||n.title.toLowerCase().includes('maduro')@@ -332,7 +310,7 @@subtitle: 'Arctic geopolitics monitoring',criticalKeywords: ['greenland', 'arctic', 'nuuk', 'denmark']}}- news={allNewsItems.filter(+ news={$allNewsItems.filter((n) =>n.title.toLowerCase().includes('greenland') ||n.title.toLowerCase().includes('arctic')@@ -361,7 +339,7 @@'khamenei']}}- news={allNewsItems.filter(+ news={$allNewsItems.filter((n) =>n.title.toLowerCase().includes('iran') ||n.title.toLowerCase().includes('tehran') ||