All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.src.utils.throttle.js Maven / Gradle / Ivy

The newest version!

export function throttle(func, limit) {
    let inThrottle

    return function() {
        let context = this, args = arguments

        if (! inThrottle) {
            func.apply(context, args)

            inThrottle = true

            setTimeout(() => inThrottle = false, limit)
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy