src/utils/intersection.js
/**
 * Convert an IntersectionObserverEntry to a regular object to make it serializable.
 *
 * @param {!IntersectionObserverEntry} entry
 * @return {!JsonObject}
 */
Convert an IntersectionObserverEntry to a regular object to make it serializable.
Convert an IntersectionObserverEntry to a regular object to make it serializable .
function intersectionEntryToJson(entry) {
  return dict({
    'time': entry.time,
    'rootBounds': safeLayoutRectFromDomRect(entry.rootBounds),
    'boundingClientRect': safeLayoutRectFromDomRect(entry.boundingClientRect),
    'intersectionRect': safeLayoutRectFromDomRect(entry.intersectionRect),
    'intersectionRatio': entry.intersectionRatio,
  });
}
function intersectionEntryToJson ( entry ) { return dict ( { 'time' : entry . time , 'rootBounds' : safeLayoutRectFromDomRect ( entry . rootBounds ) , 'boundingClientRect' : safeLayoutRectFromDomRect ( entry . boundingClientRect ) , 'intersectionRect' : safeLayoutRectFromDomRect ( entry . intersectionRect ) , 'intersectionRatio' : entry . intersectionRatio , } ) ; }
Convert an IntersectionObserverEntry to a regular object to make it serializable.
Convert an IntersectionObserverEntry to a regular object to make it serializable .