@bigmistqke/minni
TypeScript icon, indicating that this package has built-in type declarations

0.0.7 • Public • Published

🐭 minni, a minimal drag utility

import {minni} from "@bigmistqke/minni"

const mouseDownHandler = async (e: MouseEvent) => {
  console.log('start dragging')

  const delta = await minni(e, (delta, e) => {
    console.log('dragging:', delta)
    console.log('mouse-event:', e)
  })

  console.log('total drag:', delta)
}

const touchStartHandler = async (e: TouchEvent) => {
  console.log('start dragging')

  const delta = await minni(e, (delta, e) => {
    console.log('dragging:', delta)
    console.log('touch-event:', e)
  })

  console.log('total drag:', delta)
}

Readme

Keywords

none

Package Sidebar

Install

npm i @bigmistqke/minni

Weekly Downloads

0

Version

0.0.7

License

MIT

Unpacked Size

7.56 kB

Total Files

8

Last publish

Collaborators

  • bigmistqke