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

Function tryResolve

src/core/data-structures/promise.js:65–69  ·  view source on GitHub ↗
(fn)

Source from the content-addressed store, hash-verified

63 * @template T
64 */
65export function tryResolve(fn) {
66 return new Promise((resolve) => {
67 resolve(fn());
68 });
69}
70
71/**
72 * Resolves with the result of the last promise added.

Callers 15

layoutCallbackMethod · 0.90
safePlayOrPause_Method · 0.90
tryPlayFunction · 0.90
playIgnoringErrorFunction · 0.90
getRandomString64Function · 0.90
sendMessageInternal_Method · 0.90
pushMethod · 0.90
replaceMethod · 0.90
getMethod · 0.90
evaluateBindingAsync_Method · 0.90
getElementScrollTop_Method · 0.90

Calls 2

resolveFunction · 0.50
fnFunction · 0.50

Tested by

no test coverage detected