import { TypeVoidFunction } from '../types'; /** * throttle * @memberof module:functions * @function * @see https://css-tricks.com/debouncing-throttling-explained-examples/ * @param {TypeVoidFunction} fn * @param {Number} [delay=0] * @returns {TypeVoidFunction} * @example import { debounce } from '@nonoll/code-snippet/functions'; const forExample = () => { const delay = 1000 * 1; const listener = throttle(res => console.log(res), delay); listener(`1 ${new Date()}`); listener('2'); listener('3'); listener('4'); setTimeout(() => { listener(`5 ${new Date()}`); }, delay); } forExample(); */ export declare const throttle: (fn: TypeVoidFunction, delay?: number) => TypeVoidFunction;