Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/avishwakarma/preact-long-press-event
☝️ onLongPress for preact
https://github.com/avishwakarma/preact-long-press-event
Last synced: about 2 months ago
JSON representation
☝️ onLongPress for preact
- Host: GitHub
- URL: https://github.com/avishwakarma/preact-long-press-event
- Owner: avishwakarma
- Created: 2018-11-01T17:43:47.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2018-11-01T18:14:40.000Z (about 6 years ago)
- Last Synced: 2024-11-15T18:39:54.158Z (about 2 months ago)
- Language: JavaScript
- Size: 2.93 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# preact-long-press-event: `onLongPress` for __[Preact]__
`onLongPress` is a CustomEvent generated using native Event.
Inspired by [long-press]
---## Usage
`npm i -S preact-long-press-event`
```js
// in your index.jsimport injectLongPressEvent from 'preact-long-press-event';
/**
* @params {object} options
*
* Options can be an object containing duration property
*
* {
* duration:
* }
*
* The default delay duration is 1500
*/
injectLongPressEvent();// in your component
class MyComponent extends Component {
longPress(event) {
// longPress event handller
}render() {
return (
Long Press Me!
);
}
}
```
---[Preact]: https://github.com/developit/preact
[long-press]: https://github.com/john-doherty/long-press/