Wraps a query with page management for paginated reads. The query's own .limit(n) clause is
the page size -- the hook manages which page is loaded by rewriting skip/limit on top of
it; the query must not carry its own .skip().
The query's .orderBy(...) is otherwise untouched, and applies to any query the underlying
Database.Queryable supports -- e.g. Order.natural('desc') for feed insertion order.
Keeps showing the previous page while a new one loads -- across both a skip/limit move and a
query-identity change (filter/order/page-size/resource). The latter rebuilds the internal store;
the last page is handed to the new store as its seed so the view refreshes in place instead of
flashing empty, and isLoading stays put (a background refresh isn't a load the user asked for).
Wraps a query with page management for paginated reads. The query's own
.limit(n)clause is the page size -- the hook manages which page is loaded by rewritingskip/limiton top of it; the query must not carry its own.skip().The query's
.orderBy(...)is otherwise untouched, and applies to any query the underlyingDatabase.Queryablesupports -- e.g.Order.natural('desc')for feed insertion order.Keeps showing the previous page while a new one loads -- across both a
skip/limitmove and a query-identity change (filter/order/page-size/resource). The latter rebuilds the internal store; the last page is handed to the new store as its seed so the view refreshes in place instead of flashing empty, andisLoadingstays put (a background refresh isn't a load the user asked for).