@lotics/app-sdk 0.98.2 → 0.98.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/hooks.js +3 -2
- package/docs/data_fetching.md +3 -2
- package/docs/queries.md +3 -1
- package/package.json +1 -1
package/dist/src/hooks.js
CHANGED
|
@@ -227,8 +227,9 @@ export function useInfiniteQuery(alias, params, opts) {
|
|
|
227
227
|
// Keyset (seek) pagination: each page seeks past the previous page's
|
|
228
228
|
// `next_cursor` instead of an increasing OFFSET, so deep scrolls stay O(page)
|
|
229
229
|
// and never skip/duplicate a row as the set shifts. The cursor is opaque; the
|
|
230
|
-
// server keysets a sortable key (
|
|
231
|
-
// transparently. `loadMore`/`rows` are
|
|
230
|
+
// server keysets a sortable key (the query's own order when `sort` is unset,
|
|
231
|
+
// else the id) and falls back to offset transparently. `loadMore`/`rows` are
|
|
232
|
+
// unchanged — the cursor is internal.
|
|
232
233
|
const getKey = (index, prev) => {
|
|
233
234
|
if (mockRows || !enabled)
|
|
234
235
|
return null;
|
package/docs/data_fetching.md
CHANGED
|
@@ -241,8 +241,9 @@ Reads paginate two different ways, and the difference is load-bearing:
|
|
|
241
241
|
opaque cursor instead of counting an offset, so a deep scroll stays O(page) and — the reason it
|
|
242
242
|
matters — **never skips or duplicates a row as the set shifts** under concurrent inserts/deletes.
|
|
243
243
|
The cursor is internal: the hook sends it and reads the next one back; you never see it. The
|
|
244
|
-
server keysets a single sortable key (the runtime `sort`,
|
|
245
|
-
back to offset transparently for a multi-key
|
|
244
|
+
server keysets a single sortable key (the runtime `sort`, else the template's own order on a
|
|
245
|
+
column it projects, else the record id) and falls back to offset transparently for a multi-key
|
|
246
|
+
sort it can't seek. So an infinite feed needs **no
|
|
246
247
|
dedupe** — key rows by `__source_record_id` for stable React keys, not to guard against repeats.
|
|
247
248
|
- **`useQuery`, `usePaginatedQuery`, and manual `rpc("query", { limit, offset })` use offset
|
|
248
249
|
pagination** — count `offset` rows, skip them, return the next page. Two consequences a keyset
|
package/docs/queries.md
CHANGED
|
@@ -570,7 +570,9 @@ tokens fail deploy.
|
|
|
570
570
|
axes from ONE named query — don't shard into a query-per-combination. Mark each scoping param
|
|
571
571
|
`required: false`; the server **prunes every filter condition (or traversal) whose
|
|
572
572
|
`{{params.x}}` the caller didn't pass** — then collapses emptied groups — so an unset axis
|
|
573
|
-
stops constraining instead of erroring.
|
|
573
|
+
stops constraining instead of erroring. A param passed empty (`""`, `[]`, `null`) counts as not
|
|
574
|
+
passed. A REQUIRED param passed empty is refused (400, naming the condition it feeds) when a
|
|
575
|
+
filter reads it.
|
|
574
576
|
|
|
575
577
|
```jsonc
|
|
576
578
|
"search": {
|