import { TypeVoidFunction } from '../types'; /** * debounce * @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 = debounce(res => console.log(res), delay); listener('1'); listener('2'); listener('3'); listener(`4 ${new Date()}`); setTimeout(() => { listener(`5 ${new Date()}`); }, delay); } forExample(); */ export declare const debounce: (fn: TypeVoidFunction, delay?: number) => TypeVoidFunction;