![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
gesture-helper
Advanced tools
a *tiny* touch & mouse library to help make tracking touch interactions more simple.
a tiny (~5kb gzipped bundle) touch & mouse library to help make tracking touch interactions more simple.
Gesture helper extends https://github.com/asyncly/EventEmitter2, and returns an event emitter. Events can be namespaced, per EventEmitter2. This means that you can bind to events like:
tap // (for simple tap / click events)
pan.** // (wildcard for all pan-related events)
pan.prestart // (immediate touchStart event - mainly useful for immediately blocking browser behaviour)
pan.start // (the beginning of a discernable drag event)
pan.end // (the end of a detected drag event)
pan.all // (a progress event for any and all directions of finger movement)
pan.y.up // (a progress event as the finger moves up)
pan.y.down // (a progress event as the finger moves down)
pan.y.** // (wildcard for both up and down movement progress events)
pan.x.left // (a progress event as the finger moves left)
pan.x.right // (a progress event as the finger moves right)
pan.x.** // (wildcard for both left and right movement progress events)
In the interest of keeping the library small, unopinionated, and versatile - any preventDefault / stopPropogation / event bubbling related functionality is left untouched. This can be added to each application, depending on what you need.
All source touch/mouse events are returned inside all EE2 event payloads, as follows
{ ..., sourceEvent: e }
Eg. you can call ev.sourceEvent.preventDefault()
as well as other native browser event functionality, as you need it.
Per EE2, the event handler name (eg. pan.y.up
, pan.x.left
, pan.all
) is also bound to the listener function's scope as the property this.event
.
*Note: If you plan to access this property, please avoid defining handlers using arrow functions.
yarn install gesture-helper
npm i gesture-helper
then:
import GestureHelper from 'gesture-helper';
const gestureCtrl = new GestureHelper(document.querySelector('.el'), { ...options });
gestureCtrl.on('tap', (e) => {
console.log(this.event) // undefined
});
gestureCtrl.on('pan.all', function(e) {
console.log(this.event) // 'pan.all'
});
to see this component in action, run:
yarn demo
passive: false,
capture: false,
sensitivity: Number(5), // Integer: Px's movement to allow before capturing pan event
swipeVelocity: Float(0.7), // Float: Velocity threshold range for varied swipe detection
maxTapDuration: Number(300), // Integer: Milliseconds of finger being on the screen before a tap event is ignored
FAQs
a *tiny* touch & mouse library to help make tracking touch interactions more simple.
The npm package gesture-helper receives a total of 2 weekly downloads. As such, gesture-helper popularity was classified as not popular.
We found that gesture-helper demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.