"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.debounce = debounce;
/**
 * Returns a function which calls the callback function only after the specified idle time.
 *
 * @param callback Function to execute
 * @param delay Idle period in milliseconds after which the callback will be executed
 * @returns A wrapper function that should be called to invoke the callback function after delay
 */
function debounce(callback, delay) {
    let timerId;
    return (...args) => {
        clearTimeout(timerId);
        timerId = window.setTimeout(() => {
            callback(...args);
        }, delay);
    };
}
//# sourceMappingURL=Debounce.js.map