MCPcopy Index your code
hub / github.com/react/react / addTouch

Function addTouch

packages/dom-event-testing-library/touchStore.js:20–35  ·  view source on GitHub ↗
(touch)

Source from the content-addressed store, hash-verified

18const activeTouches = new Map();
19
20export function addTouch(touch) {
21 const identifier = touch.identifier;
22 const target = touch.target;
23 if (!activeTouches.has(target)) {
24 activeTouches.set(target, new Map());
25 }
26 if (activeTouches.get(target).get(identifier)) {
27 // Do not allow existing touches to be overwritten
28 console.error(
29 'Touch with identifier %s already exists. Did not record touch start.',
30 identifier,
31 );
32 } else {
33 activeTouches.get(target).set(identifier, touch);
34 }
35}
36
37export function updateTouch(touch) {
38 const identifier = touch.identifier;

Callers

nothing calls this directly

Calls 4

setMethod · 0.80
hasMethod · 0.65
getMethod · 0.65
errorMethod · 0.65

Tested by

no test coverage detected