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

Method constructor

src/service/template-impl.js:31–47  ·  view source on GitHub ↗

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

(ampdoc)

Source from the content-addressed store, hash-verified

29export class Templates {
30 /** @param {!./ampdoc-impl.AmpDoc} ampdoc */
31 constructor(ampdoc) {
32 /** @private @const */
33 this.ampdoc_ = ampdoc;
34
35 /**
36 * A map from template type to template's class promise.
37 * @private @const {!{[key: string]: !Promise<typeof ../base-template.BaseTemplate>}}
38 */
39 this.templateClassMap_ = {};
40
41 /**
42 * A map from template type to template's class promise. This is a transient
43 * storage. As soon as the template class loaded, the entry is removed.
44 * @private @const {!{[key: string]: function(typeof ../base-template.BaseTemplate)}}
45 */
46 this.templateClassResolvers_ = {};
47 }
48
49 /**
50 * Waits for template to be fully initialized.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected