class Timing
{
    /**
     * debounces functions invoked by events
     *
     * @param {function} func       function to be invoked
     * @param {number} wait         time to wait before func is invoked
     * @returns {function(...[*]=)}
     */
    static debounce (func, wait = 80)
    {
        let timeoutId = null;

        return (...args) =>
        {
            const later = () =>
            {
                timeoutId = null;
                func(...args);
            };

            clearTimeout(timeoutId);

            timeoutId = window.setTimeout(later, wait);
        };
    }
}

export default Timing;

/**
 * Debounces functions that are frequently invoked
 *
 * @param {function} func       function to be invoked
 * @param {number} delay         time to wait before func is invoked
 * @returns {function(...[*]=)}
 */
export function debounce (func, delay = 80)
{
    let timeoutId = null;

    return (...args) =>
    {
        const later = () =>
        {
            timeoutId = null;
            func(...args);
        };

        window.clearTimeout(timeoutId);

        timeoutId = window.setTimeout(later, delay);
    };
}

Refactor and properly export debounce function
Refactor and properly export debounce function
