The best way to control Claude Code, Codex and more from any computer or phone
perf(web): useAtomQueryRunner compiles without manual memoization (#20573)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Julius Marminge committed
Oct 16, 2026 at 22:05 UTC
745ca81b9d8acc447ba0336984fbca85e9698ed4
1 file changed
+10
-13
apps/web/src/state/use-atom-query-runner.ts
+10
-13
@@ -5,7 +5,7 @@ import {
5
type AtomCommandResult,
6
} from "@t3tools/client-runtime/state/runtime";
7
import { AsyncResult, type Atom } from "effect/reactivity";
8
-import { useCallback, useContext } from "react";
8
+import { useContext } from "react";
9
10
export function useAtomQueryRunner<T, A, E>(
11
family: (target: T) => Atom.Atom<AsyncResult.AsyncResult<A, E>>,
@@ -17,16 +17,13 @@ export function useAtomQueryRunner<T, A, E>(
17
const reportDefect = typeof options === "string" ? true : (options?.reportDefect ?? true);
18
const refresh = typeof options === "string" ? false : (options?.refresh ?? false);
19
20
- return useCallback(
21
- (target: T) => {
22
- const atom = family(target);
23
- return executeAtomQuery(registry, atom, {
24
- label: explicitLabel ?? atom.label?.[0] ?? "atom query",
25
- reportFailure,
26
- reportDefect,
27
- refresh,
28
- });
29
- },
30
- [explicitLabel, family, registry, refresh, reportDefect, reportFailure],
31
- );
20
+ return (target: T) => {
21
+ const atom = family(target);
22
+ return executeAtomQuery(registry, atom, {
23
+ label: explicitLabel ?? atom.label?.[0] ?? "atom query",
24
+ reportFailure,
25
+ reportDefect,
26
+ refresh,
27
+ });
28
+ };
29
}