JSFiddle - React, Tailwind, and code Playground

HTML

<div id="thing">Click me</div>

JavaScript

var thingEl = document.getElementById('thing');

thingEl.addEventListener(
    'click',
    getClickHandler(
        function () {
            console.log('click');
        },
        function () {
            console.log('dblclick');
        }
    )
);

function getClickHandler(onClick, onDblClick, delay) {
    var timeoutID = null;
    delay = delay || 250;
    return function (event) {
        if (!timeoutID) {
            timeoutID = setTimeout(function () {
                onClick(event);
                timeoutID = null
            }, delay);
        } else {
            timeoutID = clearTimeout(timeoutID);
            onDblClick(event);
        }
    };
}