File tree Expand file tree Collapse file tree 3 files changed +13
-0
lines changed Expand file tree Collapse file tree 3 files changed +13
-0
lines changed Original file line number Diff line number Diff line change 1
1
export { default as closest } from './closest' ;
2
2
export { default as requestNextAnimationFrame } from './requestNextAnimationFrame' ;
3
3
export { default as distance } from './distance' ;
4
+ export { default as touchCoords } from './touchCoords' ;
Original file line number Diff line number Diff line change
1
+ import touchCoords from './touchCoords' ;
2
+
3
+ export default touchCoords ;
Original file line number Diff line number Diff line change
1
+ /**
2
+ * Returns the first touch event found in touches or changedTouches of a touch events.
3
+ * @param {TouchEvent } event a touch event
4
+ * @return {Touch } a touch object
5
+ */
6
+ export default function touchCoords ( event = { } ) {
7
+ const { touches, changedTouches} = event ;
8
+ return ( touches && touches [ 0 ] ) || ( changedTouches && changedTouches [ 0 ] ) ;
9
+ }
You can’t perform that action at this time.
0 commit comments