UNPKG

407 BJavaScriptView Raw
1import sourceEvent from "./sourceEvent";
2import point from "./point";
3
4export default function(node, touches, identifier) {
5 if (arguments.length < 3) identifier = touches, touches = sourceEvent().changedTouches;
6
7 for (var i = 0, n = touches ? touches.length : 0, touch; i < n; ++i) {
8 if ((touch = touches[i]).identifier === identifier) {
9 return point(node, touch);
10 }
11 }
12
13 return null;
14}