MCPcopy
hub / github.com/ampproject/amphtml / runPromise

Method runPromise

src/service/vsync-impl.js:187–195  ·  view source on GitHub ↗

* Runs vsync task: measure followed by mutate. Returns the promise that * will be resolved as soon as the task has been completed. * * If state is not provided, the value passed to the measure and mutate * will be undefined. * * @param {!VsyncTaskSpecDef} task * @param {!VsyncSt

(task, opt_state)

Source from the content-addressed store, hash-verified

185 * @return {!Promise}
186 */
187 runPromise(task, opt_state) {
188 this.run(task, opt_state);
189 if (this.nextFramePromise_) {
190 return this.nextFramePromise_;
191 }
192 const deferred = new Deferred();
193 this.nextFrameResolver_ = deferred.resolve;
194 return (this.nextFramePromise_ = deferred.promise);
195 }
196
197 /**
198 * Creates a function that will call {@link run} method.

Callers 10

mutatePromiseMethod · 0.95
test-vsync.jsFile · 0.80
updateMethod · 0.80
prepareBodyForOverlayFunction · 0.80
measureMutateElementMethod · 0.80
removeOverflowItems_Method · 0.80
hide_Method · 0.80
open_Method · 0.80

Calls 1

runMethod · 0.95

Tested by

no test coverage detected