tibi-docs/frontend/src/store.ts

11 lines
388 B
TypeScript
Raw Normal View History

2023-02-21 13:36:06 +01:00
import { writable } from "svelte/store"
const initLoc = {
path: (typeof window !== "undefined" && window.location?.pathname) || "/",
search: (typeof window !== "undefined" && window.location?.search) || "",
hash: (typeof window !== "undefined" && window.location?.hash) || "",
push: false,
pop: false,
categoryPath: "",
}
export const location = writable(initLoc)