UNPKG

@web3r/flowerkit

Version:

A collection of more than 60 often used utility JS functions that simplify frontend development.

13 lines 492 B
/** * Gets a throttled function with specific delay * @param func{Function} - function * @param delay{Number=} - delay in ms, 1000 by default * @return {*} * @example * // How to implement function throttling? * const getDataFromAPI = () => Promise.resolve([]); * const getThrottledDataFromAPI = getThrottledFn(getDataFromAPI, 3000); * getThrottledFn(); // => [] */ export function getThrottledFn(func: Function, delay?: number | undefined): any; //# sourceMappingURL=index.d.ts.map