Skip to content
Source
Sign inSign up
TanStack/db

fix: reject ignored infinite-query page callbacks #1806

MergedKyleAMathews(GitHub profile, opens in a new tab)merged 5 commits intomain fromrefs/pull/1806/headmerged by KyleAMathews(GitHub profile, opens in a new tab)

Showing 16 changed files with 102 additions and 13 deletions (loading 13).

x
0 of 16 viewed, 16 left
7 additions and 0 deletions.changeset/reject-ignored-page-callback.mdAdded
View file
@@ -0,0 +1,7 @@
+---
+'@tanstack/react-db': minor
+'@tanstack/vue-db': minor
+'@tanstack/svelte-db': minor
+---
+​
+Remove the ignored `getNextPageParam` option from `useLiveInfiniteQuery` and reject it with a clear error when passed at runtime. Delete this callback from your config; for server pagination, use an on-demand Query Collection whose `queryFn` fulfills `meta.loadSubsetOptions`. Document fixed-server-page loading and clarify that `initialPageParam` labels result pages rather than setting a server cursor.
88 additions and 11 deletionsdocs/collections/query-collection.mdModified
View file
@@ -750,22 +750,99 @@
todosCollection.insert({ text: "Buy milk", completed: false })
```
​
-### Example: Large Dataset Pagination
+### Server pagination with live queries
​
+`useLiveInfiniteQuery` in React, Vue, and Svelte grows a local ordered query
+window. It does not run TanStack Query's `InfiniteQueryObserver`. Query
+Collections use `QueryObserver`, so `queryFn` receives
+`meta.loadSubsetOptions`, not `pageParam`.
+​
+The previously ignored `getNextPageParam` option has been removed. Delete it
+from your hook config; passing it at runtime now throws a clear error.
+`initialPageParam` labels result pages only. It does not set a remote offset