I'm having a hard time understanding the use of Runes and data loading.I load a supabase json file and I want to access the data globally.
// +page.server.jsexport async function load() { const [_portfolioSummary, error] = await getFullPortfolio('/'); return _portfolioSummary;}
// shared.svelte.jsexport let portfolioSummary = $state({});
// +page.jsimport { portfolioSummary } from '../lib/js/shared.svelte.js';export async function load({ data }) { portfolioSummary = data.portfolioSummary;}
I get this error:
TypeError: Cannot set property
portfolioSummary
of#<Object>
which has only a getter
What should I do to get portfolioData
globally so I can use it anywhere?