This commit is contained in:
hamid zarghami
2026-03-14 15:25:25 +03:30
parent 703ed374f4
commit 67b5944ddb
6 changed files with 90 additions and 43 deletions
+3 -6
View File
@@ -31,10 +31,7 @@ export const useUpdateCatalog = () => {
const timeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);
const scheduleUpdate = useCallback(
(
params: Parameters<typeof api.updateCatalog>[0],
delayMs = 3000
) => {
(params: Parameters<typeof api.updateCatalog>[0], delayMs = 3000) => {
if (timeoutRef.current) {
clearTimeout(timeoutRef.current);
}
@@ -43,7 +40,7 @@ export const useUpdateCatalog = () => {
mutation.mutate(params);
}, delayMs);
},
[mutation]
[mutation],
);
useEffect(
@@ -52,7 +49,7 @@ export const useUpdateCatalog = () => {
clearTimeout(timeoutRef.current);
}
},
[]
[],
);
return {