Gathering detailed insights and metrics for use-double-click
Gathering detailed insights and metrics for use-double-click
Gathering detailed insights and metrics for use-double-click
Gathering detailed insights and metrics for use-double-click
npm install use-double-click
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
63 Stars
21 Commits
5 Forks
2 Watching
11 Branches
2 Contributors
Updated on 23 Jul 2024
Minified
Minified + Gzipped
JavaScript (100%)
Cumulative downloads
Total Downloads
Last day
2.7%
1,155
Compared to previous day
Last week
2.7%
5,946
Compared to previous week
Last month
10.2%
25,006
Compared to previous month
Last year
20.9%
215,329
Compared to previous year
31
use-double-click is a simple React hook for differentiating single and double clicks on the same component.
Documentation https://timellenberger.com/libraries/use-double-click
Check out the demo on Codesandbox
onDoubleClick()
?When you double click on an element, onClick()
fires twice alongside your single onDoubleClick()
callback. This effect isn't desirable when a single click and a double click have different functions!
useDoubleClick()
waits within a latency window after a click for a secondary click, and only after this period either the onSingleClick
or onDoubleClick()
callback will fire a single time.
1yarn add use-double-click
1import { useRef } from 'react'; 2import useDoubleClick from 'use-double-click'; 3 4const Button = () => { 5 const buttonRef = useRef(); 6 7 useDoubleClick({ 8 onSingleClick: e => { 9 console.log(e, 'single click'); 10 }, 11 onDoubleClick: e => { 12 console.log(e, 'double click'); 13 }, 14 ref: buttonRef, 15 latency: 250 16 }); 17 18 return <button ref={buttonRef}>Click Me</button> 19}
Prop | Description |
---|---|
onSingleClick | A callback function for single click events |
onDoubleClick | A callback function for double click events |
ref | Dom node to watch for double clicks |
latency | The amount of time (in milliseconds) to wait before differentiating a single from a double click |
MIT © Tim Ellenberger
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 1/21 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
56 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More