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