Skip to content

Commit a715cc7

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

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

‎apps/web/src/lib/archivedThreadsState.ts‎

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import {
55
makeArchivedThreadsEnvironmentKey,
66
} from "@t3tools/client-runtime/state/threads";
77
import type { EnvironmentId } from "@t3tools/contracts";
8-
import { useCallback, useMemo } from "react";
98

109
import { orchestrationEnvironment } from "../state/orchestration";
1110
import { appAtomRegistry } from "../rpc/atomRegistry";
@@ -32,16 +31,13 @@ export function useArchivedThreadSnapshots(environmentIds: ReadonlyArray<Environ
3231
readonly isLoading: boolean;
3332
readonly refresh: () => void;
3433
} {
35-
const environmentKey = useMemo(
36-
() => makeArchivedThreadsEnvironmentKey(environmentIds),
37-
[environmentIds],
38-
);
34+
const environmentKey = makeArchivedThreadsEnvironmentKey(environmentIds);
3935
const result = useAtomValue(archivedSnapshotsAtom(environmentKey));
40-
const refresh = useCallback(() => {
36+
const refresh = () => {
4137
for (const environmentId of environmentIds) {
4238
appAtomRegistry.refresh(archivedSnapshotAtom(environmentId));
4339
}
44-
}, [environmentIds]);
40+
};
4541

4642
return {
4743
...result,

0 commit comments

Comments
 (0)