diff --git a/apps/web/src/state/use-atom-query-runner.ts b/apps/web/src/state/use-atom-query-runner.ts index d90caee210a8..81b4140b227b 100644 --- a/apps/web/src/state/use-atom-query-runner.ts +++ b/apps/web/src/state/use-atom-query-runner.ts @@ -5,7 +5,7 @@ import { type AtomCommandResult, } from "@t3tools/client-runtime/state/runtime"; import { AsyncResult, type Atom } from "effect/reactivity"; -import { useCallback, useContext } from "react"; +import { useContext } from "react"; export function useAtomQueryRunner( family: (target: T) => Atom.Atom>, @@ -17,16 +17,13 @@ export function useAtomQueryRunner( const reportDefect = typeof options === "string" ? true : (options?.reportDefect ?? true); const refresh = typeof options === "string" ? false : (options?.refresh ?? false); - return useCallback( - (target: T) => { - const atom = family(target); - return executeAtomQuery(registry, atom, { - label: explicitLabel ?? atom.label?.[0] ?? "atom query", - reportFailure, - reportDefect, - refresh, - }); - }, - [explicitLabel, family, registry, refresh, reportDefect, reportFailure], - ); + return (target: T) => { + const atom = family(target); + return executeAtomQuery(registry, atom, { + label: explicitLabel ?? atom.label?.[0] ?? "atom query", + reportFailure, + reportDefect, + refresh, + }); + }; }