export const preventEventDoubling = (eventHandler, minTimeDiff = 1000) => {
    let lastClickTime;
    return (...args) => {
        const thisClickTime = new Date().getTime();
        if (lastClickTime && thisClickTime - lastClickTime < minTimeDiff) {
            return;
        }
        lastClickTime = thisClickTime;
        return eventHandler(...args);
    };
};
