Skip to content

Commit afc1462

Browse files
committed
fix(comments): add comments
1 parent 8f29daa commit afc1462

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

src/api/query-factory.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@ import {
44
} from '@lukemorales/query-key-factory';
55

66
import { cartKeys } from './carts/query-keys';
7-
7+
type Filters = {
8+
limit?: number;
9+
offset?: number;
10+
};
811
export const postKeys = createQueryKeys('posts', {
9-
list: (filters) => [filters],
12+
list: (filters: Filters) => [filters],
1013
detail: (id) => ({
1114
queryKey: [id],
1215
contextQueries: {
@@ -17,4 +20,9 @@ export const postKeys = createQueryKeys('posts', {
1720
}),
1821
});
1922

20-
export const queryFactory = mergeQueryKeys(postKeys, cartKeys);
23+
const productsKeys = createQueryKeys('products', {
24+
list: (filters) => [filters],
25+
detail: (id) => [id],
26+
});
27+
28+
export const queryFactory = mergeQueryKeys(postKeys, cartKeys, productsKeys);

src/app/(app)/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@ import { EmptyList, FocusAwareStatusBar, Text, View } from '@/ui';
88

99
export default function Feed() {
1010
const { data, isPending, isError } = usePosts();
11+
1112
const renderItem = useCallback(
1213
({ item }: { item: Post }) => <Card {...item} />,
13-
[]
14+
[],
1415
);
1516

1617
if (isError) {

0 commit comments

Comments
 (0)