You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add loadSubset State Tracking and On-Demand Sync Mode (#669)
* wip
* refactor so both CollectionEventsManager and CollectionSubscription subclass the same event emiiter implimetation
* changeset
* rename loadMore to loadSubset
* feed the subscription object through to the loadSubset call, and add an unsunbscribed event to it
* feed subscription through to the loadSubset callback, add unsubscribe event to the subscription, fix types
* add sync mode to base colleciton
* loadSubset fn return promise or true
* add comment on setting is loading
* address review
* remove public trackLoadPromise
* setWindow returns a promise when it triggers loading subset
* feat: implement useLiveInfiniteQuery hook for React (#666)
* feat: implement useLiveInfiniteQuery hook for React
* use the new utils.setWindow to page through the results
improve types
add test that checks that we detect new pages on more rows syncing
changeset
tweaks
* isFetchingNextPage set by promise from setWindow
---------
Co-authored-by: Sam Willis <sam.willis@gmail.com>
---------
Co-authored-by: Kyle Mathews <mathews.kyle@gmail.com>
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.
Add `useLiveInfiniteQuery` hook for infinite scrolling with live updates.
6
+
7
+
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.
8
+
9
+
**Key features:**
10
+
11
+
- Automatic live updates as data changes in the collection
12
+
- Efficient pagination using dynamic window adjustment
13
+
- Peek-ahead mechanism to detect when more pages are available
14
+
- Compatible with TanStack Query's infinite query API patterns
0 commit comments