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

Function nextTick

3p/3p.js:105–112  ·  view source on GitHub ↗
(win, fn)

Source from the content-addressed store, hash-verified

103 * @param {function()} fn
104 */
105export function nextTick(win, fn) {
106 const P = win.Promise;
107 if (P) {
108 P.resolve()./*OK*/ then(fn);
109 } else {
110 win.setTimeout(fn, 0);
111 }
112}
113
114/**
115 * Run the function after all currently waiting sync scripts have been

Callers 1

test-3p.jsFile · 0.90

Calls 2

resolveMethod · 0.80
thenMethod · 0.45

Tested by

no test coverage detected