MCPcopy Create free account
hub / github.com/ampproject/amphtml / constructor

Method constructor

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

* @param {!Object} sandbox * @param {!Window} win

(sandbox, win)

Source from the content-addressed store, hash-verified

15 * @param {!Window} win
16 */
17 constructor(sandbox, win) {
18 const observers = new Set();
19 this.observers = observers;
20
21 sandbox
22 .stub(win, 'IntersectionObserver')
23 .value(function (callback, options) {
24 const observer = new IntersectionObserverStub(callback, options, () => {
25 observers.delete(observer);
26 });
27 observers.add(observer);
28 return observer;
29 });
30 }
31
32 /**
33 * @param {!Element} target

Callers

nothing calls this directly

Calls 3

valueMethod · 0.80
deleteMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected