MCPcopy Index your code
hub / github.com/ampproject/amphtml / notifySync

Method notifySync

testing/intersection-observer-stub.js:58–73  ·  view source on GitHub ↗

* @param {!IntersectionObserverEntry|!Array } entryOrEntries * @param {{ * root: (!Document|!Element|undefined), * rootMargin: (string|undefined), * thresholds: (number|!Array |undefined), * }=} options

(entryOrEntries, options = {})

Source from the content-addressed store, hash-verified

56 * }=} options
57 */
58 notifySync(entryOrEntries, options = {}) {
59 const entries = Array.isArray(entryOrEntries)
60 ? entryOrEntries
61 : [entryOrEntries];
62 this.observers.forEach((observer) => {
63 if (!matchesObserver(observer, options)) {
64 return;
65 }
66 const subEntries = entries.filter(({target}) =>
67 observer.elements.has(target)
68 );
69 if (subEntries.length > 0) {
70 observer.callback(subEntries);
71 }
72 });
73 }
74}
75
76class IntersectionObserverStub {

Callers

nothing calls this directly

Calls 5

matchesObserverFunction · 0.85
forEachMethod · 0.45
filterMethod · 0.45
hasMethod · 0.45
callbackMethod · 0.45

Tested by

no test coverage detected