@jsenv/navi 0.29.169 → 0.29.171
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/jsenv_navi.js +474 -157
- package/dist/jsenv_navi.js.map +20 -18
- package/docs/AI_INSTRUCTIONS.md +7 -0
- package/docs/actions.md +34 -0
- package/package.json +1 -1
package/docs/AI_INSTRUCTIONS.md
CHANGED
|
@@ -69,6 +69,13 @@ consistency across the app, not from any single call site.
|
|
|
69
69
|
collection (searching it is that collection's own `GET_MANY`). Companion
|
|
70
70
|
files: `docs/actions.md`, `docs/resource_with_params.md`,
|
|
71
71
|
`docs/resource_dependencies.md`.
|
|
72
|
+
- `docs/actions.md` — an action and its params: when to call the action versus
|
|
73
|
+
bind an instance, what a failing run does, the four ways to run one. Read the
|
|
74
|
+
debounce part before putting a delay on params — a debounced binding follows
|
|
75
|
+
where its signal SETTLES and never a value it only passed through, settling is
|
|
76
|
+
a comparison and not a countdown, and the in-between states a gesture writes
|
|
77
|
+
are real params that `batch()` or a better-shaped question must handle, not
|
|
78
|
+
the delay.
|
|
72
79
|
- `docs/data_states.md` — what a screen draws while its data is loading,
|
|
73
80
|
missing, stale or failed: the three questions `data`, `loading` and `error`
|
|
74
81
|
answer separately, the four combinations of the first two and what each one
|
package/docs/actions.md
CHANGED
|
@@ -102,6 +102,40 @@ is drawing it. During the delay the instance is still the previous one, holding
|
|
|
102
102
|
the previous answer — `loading` is what says a newer one is coming, don't
|
|
103
103
|
compare params by hand to find out.
|
|
104
104
|
|
|
105
|
+
### A debounced signal asks where it settles, not where it passed
|
|
106
|
+
|
|
107
|
+
The delay publishes where the signal **settles**, never a value it only passed
|
|
108
|
+
through on the way. A question that goes `A → B → A` inside the delay is the
|
|
109
|
+
question `A`: no request goes out for `B`, and `loading` never went up. Only a
|
|
110
|
+
signal that is somewhere new once the delay elapses moves the binding.
|
|
111
|
+
|
|
112
|
+
That is load-bearing rather than a nicety, because settling is a **comparison,
|
|
113
|
+
not a countdown**: `paramsSettlingSignal` is true while the signal and the
|
|
114
|
+
binding differ and false when they agree. Move the binding to a value the signal
|
|
115
|
+
is not on and nothing is left that could make them agree again — the screen is
|
|
116
|
+
told a newer answer is coming, with no delay still running to bring one, and
|
|
117
|
+
only another write to the source frees it. So a value the source never settled
|
|
118
|
+
on does not cost a stale request, it costs a screen stuck on "loading".
|
|
119
|
+
|
|
120
|
+
### The in-between states of a gesture are real params
|
|
121
|
+
|
|
122
|
+
The delay decides _when_ a question goes out, never _which_ one is coherent: it
|
|
123
|
+
sees every write, including the ones a gesture only passes through. Moving an
|
|
124
|
+
item from one slot to another by filling the new slot and then emptying the old
|
|
125
|
+
one is two writes, and between them the item is in both — a state nobody meant
|
|
126
|
+
to ask about, and a question the delay would happily send if it landed there.
|
|
127
|
+
|
|
128
|
+
Make the intermediate not matter, rather than counting on the delay to hide it.
|
|
129
|
+
Two ways, both worth having on their own:
|
|
130
|
+
|
|
131
|
+
- **`batch()` the writes that belong to one gesture**, so the intermediate state
|
|
132
|
+
never exists at all — not for the delay, not for a render, not for a
|
|
133
|
+
validation rule reading the same signals.
|
|
134
|
+
- **Shape the question so states that are equivalent compare equal.** Params are
|
|
135
|
+
compared deeply, so a list whose order carries nothing asks a new question
|
|
136
|
+
every time it is rearranged; sent deduplicated and sorted, rearranging stops
|
|
137
|
+
changing the question — better than asking it late.
|
|
138
|
+
|
|
105
139
|
## Running: `run`, `rerun`, `prerun`, `reset`
|
|
106
140
|
|
|
107
141
|
| Method | Does |
|