@devries-cameron20 / t3code Mirror · read-only / commits / 3ff9a73458
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 23, 06:45 UTC

perf(web): useAtomCommand compiles without manual memoization (#20568)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

Julius Marminge committed Oct 16, 2026 at 22:06 UTC 3ff9a734584b92f5220e8abc1fed18a5e4aebfa8
1 file changed +3 -5
apps/web/src/state/use-atom-command.ts
+3 -5
@@ -5,7 +5,7 @@ import {
5 type AtomCommandResult,
6 runAtomCommand,
7 } from "@t3tools/client-runtime/state/runtime";
8 -import { useCallback, useContext } from "react";
8 +import { useContext } from "react";
9
10 export function useAtomCommand<A, E, W>(
11 command: AtomCommand<W, A, E>,
@@ -16,8 +16,6 @@ export function useAtomCommand<A, E, W>(
16 const reportFailure = typeof options === "string" ? true : (options?.reportFailure ?? true);
17 const reportDefect = typeof options === "string" ? true : (options?.reportDefect ?? true);
18
19 - return useCallback(
20 - (value: W) => runAtomCommand(registry, command, value, { label, reportFailure, reportDefect }),
21 - [command, label, registry, reportDefect, reportFailure],
22 - );
19 + return (value: W) =>
20 + runAtomCommand(registry, command, value, { label, reportFailure, reportDefect });
21 }