@jsenv/navi 0.29.415 → 0.29.416
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/dev/jsenv_navi.js +43 -5
- package/dist/dev/jsenv_navi.js.map +3 -3
- package/dist/jsenv_navi.js +43 -5
- package/dist/jsenv_navi.js.map +3 -3
- package/docs/resource.md +7 -3
- package/docs/route_transitions.md +7 -4
- package/package.json +1 -1
package/docs/resource.md
CHANGED
|
@@ -292,9 +292,13 @@ Keep their **ids**, not the objects: an object is a snapshot, and it stops
|
|
|
292
292
|
following its row the moment anything writes to it. `RESOURCE.useAllByIds(ids)`
|
|
293
293
|
reads those rows as they are now — a kept id turned back into something that
|
|
294
294
|
stays fresh, and the ids the store no longer holds simply drop out.
|
|
295
|
-
`RESOURCE.useById(id)` is the singular, `RESOURCE.useArray()` the whole store
|
|
296
|
-
|
|
297
|
-
|
|
295
|
+
`RESOURCE.useById(id)` is the singular, `RESOURCE.useArray()` the whole store.
|
|
296
|
+
None is a hook (a `.map()` over them is fine), and each subscribes the render
|
|
297
|
+
that calls it to what it returns: `useById` and `useAllByIds` to the rows they
|
|
298
|
+
hand back — a card reading its own row stays still while other rows of the
|
|
299
|
+
store are written, and re-renders when its row is — `useArray` to the whole
|
|
300
|
+
store. An entry of `useAllByIds` given by a unique key rather than by id can
|
|
301
|
+
only be found by reading the whole store, and that read follows it too.
|
|
298
302
|
|
|
299
303
|
## Relations: pick one of the four methods
|
|
300
304
|
|
|
@@ -643,10 +643,13 @@ elements):
|
|
|
643
643
|
at a route (`<Link route>`, `<Button route>`) reads one flag — whether it is
|
|
644
644
|
current — and stays still unless that flips: a profile opening leaves the
|
|
645
645
|
links to a hundred other profiles exactly as they were (on the list of
|
|
646
|
-
thirty cards: 90 re-renders gone, first frame 58 → 41 ms).
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
the
|
|
646
|
+
thirty cards: 90 re-renders gone, first frame 58 → 41 ms). A row read with
|
|
647
|
+
`RESOURCE.useById` follows that row only, so the page arriving loading rows
|
|
648
|
+
of its own into the same store leaves the cards of the page being left as
|
|
649
|
+
they were. What reacts is then the page's own reading of its route's action
|
|
650
|
+
— its params, its data and its state all move as the route stops matching —
|
|
651
|
+
and that re-renders the page with everything in it (on the list of thirty
|
|
652
|
+
cards: about 1,150 component renders, the largest share of the callback).
|
|
650
653
|
- **Re-rendering what did not change, on the press itself.** A component that
|
|
651
654
|
only wants a yes or a no reads a computed flag, not the signal it is derived
|
|
652
655
|
from: a list whose rows each read the count of runs in flight re-rendered
|