fix: proper prefetch

This commit is contained in:
ner committed 2024-10-29 19:39:41 +02:00
1 parent c9ca262da8
commit 3b954279f7
9 files changed
+12 -15

No files matched your search

-1
View File
@@ -7,7 +7,6 @@ export type PopularQueryProps = {
};
const popularQuery = ({ sortBy = 'popularity.desc', starring }: PopularQueryProps = {}) => ({
suspense: true,
queryKey: ['popular', sortBy, starring],
initialPageParam: '1',
queryFn: ({ pageParam = '1' }: { pageParam?: string }) =>
+1 -1
View File
@@ -9,10 +9,10 @@ export const generatePage = createUniqueRandomGenerator(TOTAL_PAGES);
export type RandomQueryProps = {
page: number;
suspense: boolean;
};
const randomQuery = ({ page }: RandomQueryProps) => ({
suspense: true,
queryKey: ['random-movie'],
initialPageParam: page.toString(),
getNextPageParam: () => generatePage().toString(),
-1
View File
@@ -8,7 +8,6 @@ export type SimilarQueryProps = {
const similarQuery = ({ showId, showType }: SimilarQueryProps) => ({
enabled: Boolean(showId),
suspense: true,
queryKey: ['similar', showId, showType],
initialPageParam: '1',
queryFn: ({ pageParam = '1' }: { pageParam?: string }) =>
-1
View File
@@ -10,7 +10,6 @@ export type UsersShowsQueryProps = {
export const KEY = ({ list, showType, session }: UsersShowsQueryProps) => [`users-${list}`, showType, session];
const usersShowsQuery = ({ showType, list, session }: UsersShowsQueryProps) => ({
suspense: true,
queryKey: KEY({ list, showType, session }),
initialPageParam: '1',
queryFn: ({ pageParam = '1' }: { pageParam?: string }) =>