import { writable } from 'svelte/store'; const VIEWS = import.meta.glob('../views/*.svelte', {eager: true}); export let currentView = writable(); export function navigate(viewName) { let view = VIEWS[`../views/${viewName}.svelte`].default; currentView.set(view); } export function getView(viewName) { return VIEWS[`../views/${viewName}.svelte`].default; }