agregado Scroll infinito para las encuestas
This commit is contained in:
@@ -17,7 +17,6 @@ export function useSafeInfiniteQuery<T, K = unknown>(
|
||||
queryKey: [string, K?],
|
||||
queryFn: ({ pageParam }: { pageParam: number }) => Promise<T>,
|
||||
getNextPageParam: (lastPage: T, allPages: T[]) => number | undefined,
|
||||
// options?: Omit<UseQueryOptions<T>, 'queryKey' | 'queryFn'>
|
||||
) {
|
||||
return useInfiniteQuery({
|
||||
queryKey,
|
||||
@@ -25,20 +24,4 @@ export function useSafeInfiniteQuery<T, K = unknown>(
|
||||
getNextPageParam,
|
||||
initialPageParam: 0,
|
||||
})
|
||||
}
|
||||
|
||||
// export function useAllProductInfiniteQuery(){
|
||||
// return useInfiniteQuery({
|
||||
// queryKey:['product'],
|
||||
// queryFn: ({ pageParam = 0 }) => getAllProducts({ page: pageParam + 1, limit: 10 }),
|
||||
// getNextPageParam: (lastPage, allPages) => {
|
||||
// // Esta lógica determina el 'pageParam' para la siguiente página
|
||||
// const nextPage = allPages.length;
|
||||
// // Puedes añadir una condición para saber si hay más páginas
|
||||
// if (lastPage.data.length < 10) return undefined;
|
||||
// return nextPage;
|
||||
// },
|
||||
// initialPageParam: 0,
|
||||
// })
|
||||
|
||||
// }
|
||||
}
|
||||
Reference in New Issue
Block a user