function addTouch(touch) {
  const identifier = touch.identifier;
  const target = touch.target;
  if (!activeTouches.has(target)) {
    activeTouches.set(target, new Map());
  }
  if (activeTouches.get(target).get(identifier)) {
    // Do not allow existing touches to be overwritten
    console.error(
      'Touch with identifier %s already exists. Did not record touch start.',
      identifier,
    );
  } else {
    activeTouches.get(target).set(identifier, touch);
  }
}
Touch events state machine.

Keeps track of the active pointers and allows them to be reflected in touch events.