UNPKG

rooks

Version:

Essential React custom hooks ⚓ to super charge your components!

14 lines 571 B
type Callback<T> = (...args: T[]) => void; /** * useThrottle * Throttles a function with a timeout and ensures * that the callback function runs at most once in that duration * * @param callback The callback to throttle * @param timeout Throttle timeout * @returns [Callback, isReady] The throttled callback and if it is currently throttled * @see https://rooks.vercel.app/docs/hooks/useThrottle */ declare function useThrottle<T>(callback: Callback<T>, timeout?: number): [Callback<T>, boolean]; export { useThrottle }; //# sourceMappingURL=useThrottle.d.ts.map