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

Method setAsync

src/service/variable-source.js:236–244  ·  view source on GitHub ↗

* Sets an async 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 * version

(varName, asyncResolver)

Source from the content-addressed store, hash-verified

234 * @return {!VariableSource}
235 */
236 setAsync(varName, asyncResolver) {
237 devAssert(varName.indexOf('RETURN') == -1);
238 this.replacements_[varName] = this.replacements_[varName] || {
239 sync: undefined,
240 async: undefined,
241 };
242 this.replacements_[varName].async = asyncResolver;
243 return this;
244 }
245
246 /**
247 * Helper method to set both sync and async resolvers.

Callers 4

initializeMethod · 0.80
setBothMethod · 0.80
initializeMethod · 0.80

Calls 1

devAssertFunction · 0.90

Tested by

no test coverage detected