creddy/src/lib/routing.js

12 lines
279 B
JavaScript
Raw Normal View History

2023-04-26 13:05:51 -07:00
import { writable, get } from 'svelte/store';
2023-04-24 12:05:11 -07:00
2023-04-25 08:49:00 -07:00
2023-04-26 13:05:51 -07:00
export let views = writable();
2023-04-25 08:49:00 -07:00
export let currentView = writable();
export let previousView = writable();
2023-04-24 12:05:11 -07:00
export function navigate(viewName) {
2023-04-26 13:05:51 -07:00
let v = get(views)[`./views/${viewName}.svelte`].default;
currentView.set(v)
2023-04-25 22:10:14 -07:00
}