Skip to content
Source
Sign inSign up
TanStack/db

fix(react-db): let setWindow control limit/offset in useLiveInfiniteQuery #1553

Closedv-anton(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/1553/headopened

Showing 3 changed files with 7 additions and 9 deletions (loading 1).

x
0 of 3 viewed, 3 left
5 additions and 0 deletions.changeset/fix-infinite-query-limit-offset.mdAdded
View file
@@ -0,0 +1,5 @@
+---
+"@tanstack/react-db": patch
+---
+​
+fix(react-db): remove hardcoded limit/offset from useLiveInfiniteQuery initial query
2 additions and 9 deletionspackages/react-db/src/useLiveInfiniteQuery.tsModified
View file
@@ -195,18 +195,11 @@
}, [isCollection, queryFnOrCollection, depsKey])
​
- // Create a live query with initial limit and offset
+ // Create a live query without limit/offset — setWindow() is the sole authority
// Either pass collection directly or wrap query function
- // Use pageSize + 1 for peek-ahead detection (to know if there are more pages)
const queryResult = isCollection
? useLiveQuery(queryFnOrCollection)
- : useLiveQuery(
- (q) =>
- queryFnOrCollection(q)
- .limit(pageSize + 1)
- .offset(0),
- deps,
- )