aurelia-long-click-event
TypeScript icon, indicating that this package has built-in type declarations

1.0.5 • Public • Published

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

  • npm run watch

    • Launches sample and watches src folder
    • it does the type-checking and ts-lints on every save
    • open http://localhost:4444 to see the plugin in action.
  • npm run build

    • Produces amd/commonjs/system/es2015 builds
    • This will NOT emit/update files if you have any typescript or tslint errors

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

Package Sidebar

Install

npm i aurelia-long-click-event

Weekly Downloads

19

Version

1.0.5

License

MIT

Unpacked Size

41.6 kB

Total Files

32

Last publish

Collaborators

  • avrahamcool