cover
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user