Socket
Book a DemoInstallSign in
Socket

@dalisoft/swipe-gesture

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dalisoft/swipe-gesture

Swipe gesture library

Source
npmnpm
Version
0.0.2
Version published
Weekly downloads
2
-60%
Maintainers
1
Weekly downloads
 
Created
Source

swipe-gesture

Greenkeeper badge

Swipe gesture library

Features

  • No limit: not only for DOM
  • Handles types for your
  • Clean code
  • Performant
  • Easy
  • UMD compatible

Installation

We recommend install via npm because of it's cache and flat node modules tree

npm i @dalisoft/swipe-gesture

then you able to import to Node.js/Browser easily

// Node.js
const SwipeGesture = require("@dalisoft/swipe-gesture");

// Browser
// window.SwipeGesture OR SwipeGesture

// ES6
import SwipeGesture from "@dalisoft/swipe-gesture";

Parameters

  • onPointerDown function(e: Event) - Call like pointerdown
  • onPointerMove function(e: Event) - Call like pointermove
  • onPointerUp function(e: Event) - Call like pointerup
  • onPanX function(e: Event.X.Delta) - Call when panning horizontal
  • onPanY function(e: Event.Y.Delta) - Call when panning vertical
  • onSwipeLeft function(e: Event.X.Delta) - Call when swipe left
  • onSwipeRight function(e: Event.X.Delta) - Call when swipe right
  • onSwipeUp function(e: Event.Y.Delta) - Call when swipe up
  • onSwipeDown function(e: Event.Y.Delta) - Call when swipe down

Usage

const swipe = SwipeGesture({
  onPanX: delta => console.log("pan x delta", delta)
});

yourDom.addEventListener("pointerdown", swipe.onStart);
yourDom.addEventListener("pointermove", swipe.onMove);
yourDom.addEventListener("pointerup", swipe.onEnd);

License

MIT

Keywords

swipe-gesture

FAQs

Package last updated on 12 May 2019

Did you know?

Socket

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.

Install

Related posts