Skip to content

Commit e4d4537

Browse files
perf(web): useAtomCommand compiles without manual memoization
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 7111501 commit e4d4537

2 files changed

Lines changed: 4 additions & 5 deletions

File tree

‎apps/web/reactCompiledFiles.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,4 +96,5 @@ export const REACT_COMPILED_FILES = [
9696
"apps/web/src/components/pullRequest/PullRequestDetailPanel.tsx",
9797
"apps/web/src/components/ThreadTerminalDrawer.tsx",
9898
"apps/web/src/components/settings/SettingsPanels.tsx",
99+
"apps/web/src/state/use-atom-command.ts",
99100
] as const;

‎apps/web/src/state/use-atom-command.ts‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
type AtomCommandResult,
66
runAtomCommand,
77
} from "@t3tools/client-runtime/state/runtime";
8-
import { useCallback, useContext } from "react";
8+
import { useContext } from "react";
99

1010
export function useAtomCommand<A, E, W>(
1111
command: AtomCommand<W, A, E>,
@@ -16,8 +16,6 @@ export function useAtomCommand<A, E, W>(
1616
const reportFailure = typeof options === "string" ? true : (options?.reportFailure ?? true);
1717
const reportDefect = typeof options === "string" ? true : (options?.reportDefect ?? true);
1818

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 });
2321
}

0 commit comments

Comments
 (0)