HEX
Server: LiteSpeed
System: Linux s3604.bom1.stableserver.net 4.18.0-513.11.1.lve.el8.x86_64 #1 SMP Thu Jan 18 16:21:02 UTC 2024 x86_64
User: dmstechonline (1480)
PHP: 7.4.33
Disabled: NONE
Upload Files
File: /home/dmstechonline/businessclub.dmstech.online/wp-content/themes/rishi/js/debounce.js
const debounce = (func, delay) => {
    // Declare a variable called 'timeout' to store the timer ID
    let timeout;
    // Return an anonymous function that takes in any number of arguments
    return function (...args) {
        const later = () => {
            func(...args);
        };
        // Clear the previous timer to prevent the execution of 'func'
        clearTimeout(timeout);
        // Set a new timer that will execute 'func' after the specified delay
        timeout = setTimeout(later, delay);
    };
};

export default debounce;