Files
NapCatQQ/.pnpm-store/v3/files/08/ab42d5fc3c949c5942ef036d9191d65f25bedc6642999893104a51ed8890d93c986de5bfaf7ec7aa5643e404efef6f235291fd2a45d8c72a9e43dcb4001dcd
TanTan e311ca3275
Build NapCat Artifacts / Windows Loader Test (push) Canceled after 0s
Build NapCat Artifacts / Type Check & Test (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Framework (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Shell (push) Canceled after 0s
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

18 lines
432 B
Plaintext

import { useEffect, useRef, useMemo } from './reactImports'
import { copyWithStructuralSharing } from './rtkqImports'
export function useStableQueryArgs<T>(queryArgs: T) {
const cache = useRef(queryArgs)
const copy = useMemo(
() => copyWithStructuralSharing(cache.current, queryArgs),
[queryArgs],
)
useEffect(() => {
if (cache.current !== copy) {
cache.current = copy
}
}, [copy])
return copy
}