Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions .changeset/cruel-buckets-shop.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
---
"@tanstack/db": patch
"@tanstack/db": minor
---

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.
Added comprehensive loading state tracking and configurable sync modes to collections and live queries:

- Added `isLoadingSubset` property and `loadingSubset:change` events to all collections for tracking when data is being loaded
- Added `syncMode` configuration option to collections:
- `'eager'` (default): Loads all data immediately during initial sync
- `'on-demand'`: Only loads data as requested via `loadSubset` calls
- Added comprehensive status tracking to collection subscriptions with `status` property (`'ready'` | `'loadingSubset'`) and events (`status:change`, `status:ready`, `status:loadingSubset`, `unsubscribed`)
- Live queries automatically reflect loading state from their source collection subscriptions, with each query maintaining isolated loading state to prevent status "bleed" between independent queries
- Enhanced `setWindow` utility to return `Promise<void>` when loading is triggered, allowing callers to await data loading completion
- Added `subscription` parameter to `loadSubset` handler for advanced sync implementations that need to track subscription lifecycle
Loading