JSPM

touch-event

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 7
  • Score
    100M100P100Q37175F
  • License MIT

Touch events for value-event

Package Exports

  • touch-event

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (touch-event) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

touch-event Build Status

Touch events for value-event

Install

$ npm install --save touch-event

Usage

var touchEvent = require('touch-event')
var h = require('virtual-dom/h')

h('div', {
  'ev-touchmove': touchEvent.move(moveHandler)
})

API

touchEvent.start(handler, [data]) -> function

touchEvent.end(handler, [data]) -> function

touchEvent.move(handler, [data]) -> function

touchEvent.cancel(handler, [data]) -> function

handler

Required
Type: function

The handler to call when the element receives the specified touch event.

data

Type: object
Default: {}

Data to pass to the handler when the element is scrolled. This will be extended with an array of touches objects. Touch data will be nested:

[
  {
    client: {x, y}
    //...
  }
]

License

MIT © Ben Drucker