From fdbeffe78e5cd7393d28915189ec518a06b941f1 Mon Sep 17 00:00:00 2001
From: ivarlovlie <git@ivarlovlie.no>
Date: Sat, 4 Jun 2022 13:54:44 +0200
Subject: feat: !WIP start implementation of svelte-query

---
 apps/projects/src/app/index.svelte | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

(limited to 'apps/projects/src/app/index.svelte')

diff --git a/apps/projects/src/app/index.svelte b/apps/projects/src/app/index.svelte
index 9dd2bf8..c217797 100644
--- a/apps/projects/src/app/index.svelte
+++ b/apps/projects/src/app/index.svelte
@@ -5,6 +5,7 @@
 	import {logout_user} from "$app/lib/services/user-service";
 	import Router from "svelte-spa-router";
 	import {wrap} from "svelte-spa-router/wrap";
+	import {QueryClient, QueryClientProvider} from "@sveltestack/svelte-query";
 	import {is_active} from "$shared/lib/session";
 	import UiWorkbench from "$app/pages/ui-workbench.svelte";
 	import NotFound from "$app/pages/not-found.svelte";
@@ -22,6 +23,9 @@
 		return true;
 	}
 
+	const queryClient = new QueryClient();
+
+	
 	const routes = {
 		"/home": wrap({
 			component: Home,
@@ -44,13 +48,15 @@
 	};
 </script>
 <PreHeader show="{!online}">You seem to be offline, please check your internet connection.</PreHeader>
-<Router
-        {routes}
-        restoreScrollState={true}
-        on:routeLoading={() => {
+<QueryClientProvider client={queryClient}>
+    <Router
+            {routes}
+            restoreScrollState={true}
+            on:routeLoading={() => {
             document.getElementById("loader").style.display = "inline-block";
         }}
-        on:routeLoaded={() => {
+            on:routeLoaded={() => {
             document.getElementById("loader").style.display = "none";
         }}
-/>
+    />
+</QueryClientProvider>
-- 
cgit v1.3

