Kitto
    Preparing search index...

    Module throttle

    Throttles a function to run at most once every specified delay

    2.0.0

    The function to throttle

    The minimum time between function calls in milliseconds

    A throttled version of the passed function

    // Throttle a scroll event handler
    const throttled_scroll = throttle(() => {
    console.log('Scroll event throttled');
    }, 1000);

    // Add the throttled function as an event listener
    window.addEventListener('scroll', throttled_scroll);

    // Now, the console will log at most once every 1000ms during scrolling

    Functions

    throttle