@jsenv/navi 0.29.463 → 0.29.464

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.
@@ -511,15 +511,30 @@ on, and the position stays for the visit that brings it back. What it costs: a
511
511
  slow read that every page asks for delays the position of every page, since
512
512
  nothing tells navi which reads set the height.
513
513
 
514
- A route action that starts asking later is waited for too: one gated on app
515
- state the page did not have yet (`when`, or params that read an app-wide read
516
- such as the signed-in user), or one whose params are another's answer. Before it
517
- asks, nothing tells "not yet" from "never", so the position is written into what
518
- the page shows — and stays pending while a route action of the page has not
519
- asked: the next one that starts without an answer is waited for the same way,
520
- and the position is put back again once it is drawn. It ends once every route
521
- action of the page has asked; an action that never asks on this page (a search
522
- with no query) keeps it pending until the reader takes over.
514
+ A route action that starts asking later is waited for when it says what it
515
+ waits for: its `when`, a condition on app state the page did not have yet (the
516
+ signed-in user, an age gate). The position is written into what the page shows
517
+ and stays pending while a `when` of the page says no; the action that starts
518
+ once it holds is waited for the same way, and the position is put back again
519
+ once it is drawn. Params that say no are not waited for: they read the address,
520
+ and this one asks nothing of the action — when it asks later (a search typed),
521
+ the page has changed under the reader, and writing the old position would undo
522
+ whatever they or the app did meanwhile. So a gate on app state goes in `when`,
523
+ and the params keep what depends on the page:
524
+
525
+ ```js
526
+ const BOOK_ACTION = routeAction(
527
+ BOOK_ROUTE,
528
+ BOOK.GET,
529
+ () => ({ slug: bookSlugSignal.value }),
530
+ { when: () => catalogOpenSignal.value },
531
+ );
532
+ ```
533
+
534
+ A `when` that never holds on this page (a reader who is not an admin) keeps the
535
+ position pending until the reader takes over. An action whose params are
536
+ another's answer needs nothing: the position is read again once that answer is
537
+ drawn, and the action asking by then is waited for.
523
538
 
524
539
  **What navi cannot see, the page says**: a read it starts itself
525
540
  (`useAsyncData(…, { run: true })`), content whose height arrives late. While
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsenv/navi",
3
- "version": "0.29.463",
3
+ "version": "0.29.464",
4
4
  "type": "module",
5
5
  "description": "Library of components including navigation to create frontend applications",
6
6
  "repository": {