2023-04-25 08:49:00 -07:00
|
|
|
import { writable, derived } from 'svelte/store';
|
2023-04-24 12:05:11 -07:00
|
|
|
|
2023-04-25 08:49:00 -07:00
|
|
|
const VIEWS = import.meta.glob('../views/*.svelte', {eager: true});
|
2023-04-24 12:05:11 -07:00
|
|
|
|
2023-04-25 08:49:00 -07:00
|
|
|
|
|
|
|
export let currentView = writable();
|
2023-04-24 12:05:11 -07:00
|
|
|
|
|
|
|
export function navigate(viewName) {
|
2023-04-25 08:49:00 -07:00
|
|
|
let view = VIEWS[`../views/${viewName}.svelte`].default;
|
|
|
|
currentView.set(view);
|
2023-04-24 12:05:11 -07:00
|
|
|
}
|
2023-04-25 08:49:00 -07:00
|
|
|
|
|
|
|
navigate('Home');
|