]> git.r.bdr.sh - rbdr/forum/blobdiff - src/lib/stores/forums.ts
Use tailwind, reference types
[rbdr/forum] / src / lib / stores / forums.ts
index cb62b5a037f2cf5db6e9175497de3f07156bda14..8a395b329d2c29df02b9c4dec704c4adccf5374f 100644 (file)
@@ -1,5 +1,9 @@
 import { store } from './apollo';
 import { GET_FORUM, GET_FORUMS } from '$lib/data/queries';
 
-export const getForum = (id: string) => store({ key: 'forum', query: GET_FORUM, variables: { id } });
-export const getForums = () => store({ key: 'forums', query: GET_FORUMS, initialValue: [] });
+import type { Forum } from '$lib/data/types';
+
+export const getForum = (id: string) =>
+       store<Forum>({ key: 'forum', query: GET_FORUM, variables: { id } });
+export const getForums = () =>
+       store<Forum[]>({ key: 'forums', query: GET_FORUMS, initialValue: [] });