src/IntersectionObserverController.js
function debounce(callback, delay = 0) {
    let timeoutID = false;

    return function (...args) {
        if (timeoutID !== false) {
            clearTimeout(timeoutID);
        }

        timeoutID = setTimeout(() => {
            timeoutID = false;

            callback.apply(this, args);
        }, delay);
    };
}
function debounce(callback, delay = 0) {
    let timeoutID = false;

    return function (...args) {
        if (timeoutID !== false) {
            clearTimeout(timeoutID);
        }

        timeoutID = setTimeout(() => {
            timeoutID = false;

            callback.apply(this, args);
        }, delay);
    };
}
function debounce ( callback , delay = 0 ) { let timeoutID = false ; return function ( ... args ) { if ( timeoutID !== false ) { clearTimeout ( timeoutID ) ; } timeoutID = setTimeout ( ( ) => { timeoutID = false ; callback . apply ( this , args ) ; } , delay ) ; } ; }
Creates a wrapper function that ensures that
provided callback will be invoked only after
the specified delay.

@param {Function} callback
@param {Number} [delay = 0]
@returns {Function}
Creates a wrapper function that ensures that provided callback will be invoked only after the specified delay .