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

Function waitForService

test/unit/test-render-delaying-services.js:116–124  ·  view source on GitHub ↗
(env, getService, serviceId, service)

Source from the content-addressed store, hash-verified

114});
115
116function waitForService(env, getService, serviceId, service) {
117 let resolve = null;
118 getService.withArgs(env.sandbox.match.any, serviceId).returns(
119 new Promise((r) => {
120 resolve = r.bind(this, service);
121 })
122 );
123 return resolve;
124}
125
126function addExtensionScript(win, extensionName) {
127 const scriptElement = win.document.createElement('script');

Calls

no outgoing calls

Tested by

no test coverage detected