manuelernestog/click-handler

npm (scoped) npm bundle size (minified)

Handle click and dblclick events on same element on javascript.

Install

$ npm install @manuelernestog/click-handler
// or
$ yarn add @manuelernestog/click-handler

Usage

import ClickHandler from("@manuelernestog/click-handler");

const clickDelay = 500; // delay it's optional (350 miliseconds by default)
var clickHandler = new ClickHandler(clickDelay);

// Call the handle method inside your click action
function onClick() {
    clickHandler.handle(onClickActions,onDblClickActions);
}

function onClickActions() {...}
function onDblClickActions() {...}

GitHub

View Github