Skip to content
Source
Sign inSign up
TanStack/db

Add loadSubset State Tracking and On-Demand Sync Mode #669

Mergedsamwillis(GitHub profile, opens in a new tab)merged 15 commits intomain fromrefs/pull/669/headmerged by samwillis(GitHub profile, opens in a new tab)

Showing 17 changed files with 88 additions and 74 deletions (loading 14).

x
0 of 17 viewed, 17 left
5 additions and 0 deletions.changeset/cruel-buckets-shop.mdAdded
View file
@@ -0,0 +1,5 @@
+---
+"@tanstack/db": patch
+---
+​
+Added `isLoadingMore` property and `loadingMore:change` events to collections and live queries, enabling UIs to display loading indicators when more data is being fetched via `syncMore`. Each live query maintains its own isolated loading state based on its subscriptions, preventing loading status "bleed" between independent queries that share the same source collections.
58 additions and 0 deletions.changeset/smooth-goats-ring.mdAdded
View file
@@ -0,0 +1,58 @@
+---
+"@tanstack/react-db": patch
+---
+​
+Add `useLiveInfiniteQuery` hook for infinite scrolling with live updates.
+​
+The new `useLiveInfiniteQuery` hook provides an infinite query pattern similar to TanStack Query's `useInfiniteQuery`, but with live updates from your local collection. It uses `liveQueryCollection.utils.setWindow()` internally to efficiently paginate through ordered data without recreating the query on each page fetch.
+​
+**Key features:**
+​
+- Automatic live updates as data changes in the collection
+- Efficient pagination using dynamic window adjustment
+- Peek-ahead mechanism to detect when more pages are available
+- Compatible with TanStack Query's infinite query API patterns
+​
+**Example usage:**
+​