Skip to content

Commit ff724f9

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

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

‎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)