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

Method constructor

src/service/loading-indicator.js:38–53  ·  view source on GitHub ↗

* @param {!./ampdoc-impl.AmpDoc} ampdoc

(ampdoc)

Source from the content-addressed store, hash-verified

36 * @param {!./ampdoc-impl.AmpDoc} ampdoc
37 */
38 constructor(ampdoc) {
39 /** @private @const */
40 this.ampdoc_ = ampdoc;
41
42 const {win} = ampdoc;
43 const inViewport = this.inViewport_.bind(this);
44 const ioCallback = (records) =>
45 /** @type {!Array<!IntersectionObserverEntry>} */ (records).forEach(
46 inViewport
47 );
48 /** @private @const {!IntersectionObserver} */
49 this.io_ = createViewportObserver(ioCallback, win);
50
51 /** @private @const {!WeakMap<!AmpElement, !LoadingIndicatorStateDef>} */
52 this.states_ = new WeakMap();
53 }
54
55 /** @override */
56 dispose() {

Callers

nothing calls this directly

Calls 1

createViewportObserverFunction · 0.90

Tested by

no test coverage detected