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

Method animate_

third_party/subscriptions-project/swg.js:12005–12014  ·  view source on GitHub ↗

* @param {function():!Promise} callback * @return {!Promise} * @private

(callback)

Source from the content-addressed store, hash-verified

12003 * @private
12004 */
12005 animate_(callback) {
12006 const wait = this.animating_ || Promise.resolve();
12007 return (this.animating_ = wait
12008 .then(() => callback())
12009 // Ignore errors to make sure animations don't get stuck.
12010 .catch(() => {})
12011 .then(() => {
12012 this.animating_ = null;
12013 }));
12014 }
12015
12016 /**
12017 * Closes the toast.

Callers 2

buildToast_Method · 0.95
closeMethod · 0.95

Calls 4

resolveMethod · 0.80
catchMethod · 0.80
callbackFunction · 0.50
thenMethod · 0.45

Tested by

no test coverage detected