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
The `useListView` hook returns a tuple of `[items, loadNext, loadPrevious, state]`:
562
+
563
+
-`items` - all currently loaded items projected through the view, reactively updated
564
+
-`loadNext` - function to load the next page, or `undefined` if no more pages or a load is in flight
565
+
-`loadPrevious` - function to load the previous page (only present for `direction: "backward"` or `"both"`), or `undefined` if at the start or a load is in flight
566
+
-`state` - pagination state including `hasNextPage`, `hasPreviousPage`, `isLoadingNext`, `isLoadingPrevious`, `error`, `totalCount`, `loadedCount`
567
+
568
+
Items are deduplicated by `getKey`, so calling `loadNextPage` twice with the
569
+
same cursor is safe. Use `useRefetchPaginated(collection)` to get a stable
570
+
refetch callback for refresh buttons (clears all loaded data and re-fetches
571
+
the first page).
572
+
573
+
The collection exposes all pagination primitives via `collection.utils`:
574
+
575
+
-`loadNextPage()` - fetch the next page
576
+
-`loadPreviousPage()` - fetch the previous page (undefined for forward-only)
577
+
-`refetchFirstPage()` - clear all data and re-fetch the first page
578
+
-`subscribe(callback)` - subscribe to pagination state changes
579
+
-`getState()` - get the current pagination state snapshot
580
+
-`getCollection()` - get the underlying collection instance
581
+
504
582
## DB file routes
505
583
506
584
The main application-level value of the React entrypoint is its DB file-route
0 commit comments