Skip to content
Source
Sign inSign up
TanStack/db

feat(db): shared live-query window controller (RFC #1623 phase 5) #1675

Mergedkevin-dp(GitHub profile, opens in a new tab)merged 49 commits intomain fromrefs/pull/1675/headmerged by KyleAMathews(GitHub profile, opens in a new tab)

Showing 15 changed files with 31 additions and 3 deletions (loading 12).

x
0 of 15 viewed, 15 left
10 additions and 0 deletions.changeset/live-query-window-controller.mdAdded
View file
@@ -0,0 +1,10 @@
+---
+'@tanstack/db': patch
+'@tanstack/react-db': patch
+---
+​
+Add the unstable, internal `createLiveQueryWindowController` primitive for
+forward pagination. It coordinates collection-scoped window leases, commits
+pages only after subset loads succeed, restores windows after failures and
+cleanup, and lets React's `useLiveInfiniteQuery` become a thin binding without
+changing its public API or resetting pages for structurally equal dependencies.
16 additions and 3 deletionspackages/db/src/collection/changes.tsModified
View file
@@ -29,6 +29,7 @@
public changeSubscriptions = new Set<CollectionSubscription>()
public batchedEvents: Array<ChangeMessage<TOutput, TKey>> = []
public shouldBatchEvents = false