Home

Awesome

aurelia-long-click-event

aurelia plugin for long-click event.

License: MIT Issues

NPMVersion NPMDownloads NPMSize

Total alerts Language grade: JavaScript DeepScan grade

How to Use

install the plugin using yarn or npm.

yarn add aurelia-long-click-event
npm install aurelia-long-click-event

initialize the plugin in your main.js or main.ts.

  import { PLATFORM } from "aurelia-pal";

  aurelia.use
    .standardConfiguration()
    .developmentLogging()
+    .plugin(PLATFORM.moduleName("aurelia-long-click-event"));

you can pass optional configuration to control the name of the long-click event (defaults to "long-click"), and the click duration (defaults to 500 ms).

  import { LongClickConfig } from "aurelia-long-click-event"; // (TS users can use this interface for strongly typed config)
    ...
    .plugin(PLATFORM.moduleName("aurelia-long-click-event"), { longClickEventName: "long-click", clickDurationMS: 500 });

now you can register callbacks to the event just like any regular event (using trigger or delegate)

<button long-click.delegate="longClick()">long click me</button>

plugin was build using:

How to build and run sample

I Need help regarding how to test the plugin - PR welcome