TelegramPWA/src/hooks/useRunThrottled.ts
2023-02-28 18:43:28 +01:00

9 lines
318 B
TypeScript

import useThrottledCallback from './useThrottledCallback';
export default function useRunThrottled(ms: number, noFirst?: boolean, deps: any = []) {
return useThrottledCallback((cb: NoneToVoidFunction) => {
cb();
// eslint-disable-next-line react-hooks-static-deps/exhaustive-deps
}, deps, ms, noFirst);
}