UNPKG
@withvoid/melting-pot
Version:
latest (1.6.0)
1.6.0
1.5.3
1.5.2
1.5.1
1.5.0
1.4.2
1.4.1
1.4.0
1.3.0
1.2.10
1.2.9
1.2.8
1.2.7
1.2.6
1.2.5
1.2.4
1.2.3
1.2.2
1.2.1
1.2.0
1.1.0
1.0.5
1.0.4
1.0.3
1.0.2
1.0.0
A react utility library
github.com/withvoid/melting-pot
withvoid/melting-pot
@withvoid/melting-pot
/
src
/
hooks
/
useTouch.js
15 lines
(12 loc)
•
272 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import
React
from
'react'
;
const
useTouch
= (
) => {
const
[touched, setTouched] =
React
.
useState
(
false
);
return
{ touched,
bind
: {
onTouchStart
:
() =>
setTouched
(
true
),
onTouchEnd
:
() =>
setTouched
(
false
), }, }; };
export
default
useTouch;