* 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)
| 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. |
no test coverage detected