]> git.r.bdr.sh - rbdr/forum/blob - src/lib/stores/forums.ts
0ff09f7b5f6eca3b3e268ef72fabe1b0372733a3
[rbdr/forum] / src / lib / stores / forums.ts
1 import { store } from './apollo';
2 import { GET_FORUM, GET_FORUMS } from '$lib/data/queries';
3
4 import type { Forum } from '$lib/data/types';
5
6 export const getForum = (id: string) =>
7 store<Forum>({ key: 'forum', query: GET_FORUM, variables: { id } });
8 export const getForums = () =>
9 store<Forum[]>({ key: 'forumsCollection', query: GET_FORUMS, initialValue: [] });