completely cleanup of the legacy hono router to leaner svelte remote functions
This commit is contained in:
@@ -2,13 +2,7 @@
|
||||
import { goto } from "$app/navigation";
|
||||
import { mainNavTree } from "$lib/core/constants";
|
||||
import { breadcrumbs } from "$lib/global.stores";
|
||||
import { makeClient } from "$lib/make-client.js";
|
||||
import { onMount } from "svelte";
|
||||
import type { PageData } from "./$types";
|
||||
|
||||
let { data }: { data: PageData } = $props();
|
||||
|
||||
const client = makeClient(fetch);
|
||||
|
||||
breadcrumbs.set([mainNavTree[0]]);
|
||||
|
||||
|
||||
@@ -1,25 +1,11 @@
|
||||
<script lang="ts">
|
||||
import { browser } from "$app/environment";
|
||||
import { Toaster } from "$lib/components/ui/sonner/index.js";
|
||||
import { QueryClient, QueryClientProvider } from "@tanstack/svelte-query";
|
||||
import { ModeWatcher } from "mode-watcher";
|
||||
|
||||
import { apiClient, breadcrumbs } from "$lib/global.stores";
|
||||
import { makeClient } from "$lib/make-client";
|
||||
import { onMount } from "svelte";
|
||||
import { breadcrumbs } from "$lib/global.stores";
|
||||
import "./layout.css";
|
||||
|
||||
let { children }: { children: any } = $props();
|
||||
|
||||
const queryClient = new QueryClient({
|
||||
defaultOptions: {
|
||||
queries: { enabled: browser },
|
||||
},
|
||||
});
|
||||
|
||||
onMount(() => {
|
||||
apiClient.set(makeClient(fetch));
|
||||
});
|
||||
</script>
|
||||
|
||||
<svelte:head>
|
||||
@@ -31,6 +17,4 @@
|
||||
<ModeWatcher />
|
||||
<Toaster />
|
||||
|
||||
<QueryClientProvider client={queryClient}>
|
||||
{@render children()}
|
||||
</QueryClientProvider>
|
||||
{@render children()}
|
||||
|
||||
Reference in New Issue
Block a user