@lotics/ui 44.0.0 → 44.1.0
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/docs/catalog.md +10 -0
- package/package.json +2 -1
package/docs/catalog.md
CHANGED
|
@@ -2036,6 +2036,16 @@ component rather than showing it at zero.
|
|
|
2036
2036
|
`Popover` otherwise. A popover's own anchored-vs-sheet presentation is NOT one of them —
|
|
2037
2037
|
`PopoverContent` reads this itself and takes no prop. Everything spatial wants
|
|
2038
2038
|
`useContainerSize`.
|
|
2039
|
+
- **`use_debounced_callback`** — `useDebouncedCallback(fn, ms)`: run `fn` only once its caller
|
|
2040
|
+
has stopped calling, returning the debounced function plus `.cancel()`. The latest `fn` always
|
|
2041
|
+
wins (held by ref, so a new closure each render never resets the timer) and a pending call is
|
|
2042
|
+
dropped on unmount. **Reach for it whenever typing drives a request** — a search box wired
|
|
2043
|
+
straight to a query param spends one round trip per letter, and on a list screen each letter
|
|
2044
|
+
is several (the page, its count, any sibling query). Keep the input's own value in state and
|
|
2045
|
+
debounce the COMMIT to a second value: the two are genuinely different things, and a screen
|
|
2046
|
+
usually needs both (what is being typed vs. what the results answer). `.cancel()` is for when
|
|
2047
|
+
a trailing call has been overtaken — a picked option, a cleared box. `Combobox` searches
|
|
2048
|
+
through it.
|
|
2039
2049
|
- **`use_async_fn`** — `useAsyncFn`: wrap an async function into a manual-trigger mutation —
|
|
2040
2050
|
`[run, {loading, data, error}]`, unmount-safe, the error lands in state AND rethrows; the
|
|
2041
2051
|
pending-state engine for a submit/download/upload action.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lotics/ui",
|
|
3
|
-
"version": "44.
|
|
3
|
+
"version": "44.1.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
"./vite": {
|
|
@@ -262,6 +262,7 @@
|
|
|
262
262
|
"default": "./src/wave_avatar.web.tsx"
|
|
263
263
|
},
|
|
264
264
|
"./use_async_fn": "./src/use_async_fn.ts",
|
|
265
|
+
"./use_debounced_callback": "./src/use_debounced_callback.ts",
|
|
265
266
|
"./use_form": "./src/use_form.ts",
|
|
266
267
|
"./scroll_to_bottom": "./src/scroll_to_bottom.tsx",
|
|
267
268
|
"./animation_fade_in": "./src/animation_fade_in.tsx",
|