touch-event
v1.0.0
Published
Touch events for value-event
Downloads
2
Maintainers
Readme
touch-event
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