/* eslint-disable prefer-rest-params */
export function debounce(wait, fn) {
    if (wait <= 0) {
        return fn;
    }
    let timeoutId;
    return function () {
        clearTimeout(timeoutId);
        timeoutId = setTimeout(() => {
            timeoutId = undefined;
            fn.apply(this, [...arguments]);
        }, wait);
    };
}
//# sourceMappingURL=debounce.js.map