MCPcopy Create free account
hub / github.com/bvaughn/react-virtualized / getObserverCount

Function getObserverCount

lib/utils/test/mockResizeObserver.ts:65–73  ·  view source on GitHub ↗
(element: Element)

Source from the content-addressed store, hash-verified

63
64/** Returns the number of mock observers currently observing the specified element. */
65export function getObserverCount(element: Element) {
66 let count = 0;
67 observers.forEach((observer) => {
68 if (observer.isObserving(element)) {
69 count++;
70 }
71 });
72 return count;
73}
74
75/** Simulates the element being resized (notifying the observers of that element). */
76export function setElementSize({

Callers 5

List.test.tsxFile · 0.90
Masonry.test.tsxFile · 0.90
Table.test.tsxFile · 0.90
Grid.test.tsxFile · 0.90

Calls 1

isObservingMethod · 0.80

Tested by

no test coverage detected