1.4.1 • Published 2 years ago

@manuelernestog/click-handler v1.4.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

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);

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

// Call the handle method inside your click action
function onClick() {

    clickHandler.handle(onClickActions,onDblClickActions);

    // If you need to handle this behavior in different elements in the same view, add the ID for isolating the state of each element
 clickHandler.handle(onClickActions,onDblClickActions,elementId);

}
1.4.1

2 years ago

1.4.0

2 years ago

1.3.0

2 years ago

1.2.0

2 years ago

1.1.0

2 years ago

1.0.0

2 years ago