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

Method set

src/service/variable-source.js:216–224  ·  view source on GitHub ↗

* Sets a synchronous value resolver for the variable with the specified name. * The value resolver may optionally take an extra parameter. * Can be called in conjunction with setAsync to allow for additional * asynchronous resolver where expand will use async and expandSync the sync * ve

(varName, syncResolver)

Source from the content-addressed store, hash-verified

214 * @return {!VariableSource}
215 */
216 set(varName, syncResolver) {
217 devAssert(varName.indexOf('RETURN') == -1);
218 this.replacements_[varName] = this.replacements_[varName] || {
219 sync: undefined,
220 async: undefined,
221 };
222 this.replacements_[varName].sync = syncResolver;
223 return this;
224 }
225
226 /**
227 * Sets an async value resolver for the variable with the specified name.

Callers 1

setBothMethod · 0.95

Calls 1

devAssertFunction · 0.90

Tested by

no test coverage detected