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

Method constructor

testing/resize-observer-stub.js:11–22  ·  view source on GitHub ↗
(sandbox, win)

Source from the content-addressed store, hash-verified

9
10class ResizeObservers {
11 constructor(sandbox, win) {
12 const observers = new Set();
13 this.observers = observers;
14
15 sandbox.stub(win, 'ResizeObserver').value(function (callback) {
16 const observer = new ResizeObserverStub(callback, () => {
17 observers.delete(observer);
18 });
19 observers.add(observer);
20 return observer;
21 });
22 }
23
24 /**
25 * @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