dist/resizilla.js
function debounce(callback, delay, lead) {
    var debounceRange = 0;
    var currentTime;
    var lastCall;
    var setDelay;
    var timeoutId;

    const call = parameters => {
        callback(parameters);
    };

    return parameters => {
        if (lead) {
            currentTime = Date.now();
            if (currentTime > debounceRange) {
                callback(parameters);
            }
            debounceRange = currentTime + delay;
        } else {
            /**
             * setTimeout is only used with the trail option.
             */
            clearTimeout(timeoutId);
            timeoutId = setTimeout(function () {
                call(parameters);
            }, delay);
        }
    };
}
function debounce(callback, delay, lead) {
    var debounceRange = 0;
    var currentTime;
    var lastCall;
    var setDelay;
    var timeoutId;

    const call = parameters => {
        callback(parameters);
    };

    return parameters => {
        if (lead) {
            currentTime = Date.now();
            if (currentTime > debounceRange) {
                callback(parameters);
            }
            debounceRange = currentTime + delay;
        } else {
            /**
             * setTimeout is only used with the trail option.
             */
            clearTimeout(timeoutId);
            timeoutId = setTimeout(function () {
                call(parameters);
            }, delay);
        }
    };
}
function debounce ( callback , delay , lead ) { var debounceRange = 0 ; var currentTime ; var lastCall ; var setDelay ; var timeoutId ; const call = parameters => { callback ( parameters ) ; } ; return parameters => { if ( lead ) { currentTime = Date . now ( ) ; if ( currentTime > debounceRange ) { callback ( parameters ) ; } debounceRange = currentTime + delay ; } else { /**
             * setTimeout is only used with the trail option.
             */ clearTimeout ( timeoutId ) ; timeoutId = setTimeout ( function ( ) { call ( parameters ) ; } , delay ) ; } } ; }
Debounce a function call during repetiton.
@param {Function}  callback - Callback function.
@param {Number}    delay    - Delay in milliseconds.
@param {Boolean}   lead  - Leading or trailing.
@return {Function} - The debounce function.
Debounce a function call during repetiton .