https://github.com/developit/preact-tap-event-plugin
☝️ onTouchTap for preact
https://github.com/developit/preact-tap-event-plugin
Last synced: 5 months ago
JSON representation
☝️ onTouchTap for preact
- Host: GitHub
- URL: https://github.com/developit/preact-tap-event-plugin
- Owner: developit
- Created: 2016-12-05T20:35:47.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2019-03-25T15:24:23.000Z (almost 7 years ago)
- Last Synced: 2025-04-10T11:16:10.823Z (9 months ago)
- Language: JavaScript
- Homepage: https://npm.im/preact-tap-event-plugin
- Size: 8.79 KB
- Stars: 17
- Watchers: 3
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# preact-tap-event-plugin: `onTouchTap` _for [Preact]_
[](https://www.npmjs.com/package/preact-tap-event-plugin)
[](https://travis-ci.org/developit/preact-tap-event-plugin)
`onTouchTap` is a [FastClick]-style instant "click" event, triggered by `touchstart` and `touchend` occurring within a 10-pixel radius.
> This module intentionally has the same interface as [react-tap-event-plugin](https://github.com/zilverline/react-tap-event-plugin) so that it can be used as a drop-in alias when working with [preact-compat](https://github.com/developit/preact-compat).
#### [JSFiddle Demo](https://jsfiddle.net/developit/rq877gp3/)
---
## Usage Example
`npm i -S preact-tap-event-plugin`
```js
import injectTapEventPlugin from 'preact-tap-event-plugin';
injectTapEventPlugin();
```
---
## License
[MIT]
[Preact]: https://github.com/developit/preact
[FastClick]: https://github.com/ftlabs/fastclick
[MIT]: http://choosealicense.com/licenses/mit/