MCPcopy
hub / github.com/webpack/webpack / waitForBlockingPromises

Function waitForBlockingPromises

lib/hmr/HotModuleReplacement.runtime.js:362–371  ·  view source on GitHub ↗

* @param {() => Promise<ModuleId[]>} fn function to run once unblocked * @returns {Promise<ModuleId[]>} result of fn

(fn)

Source from the content-addressed store, hash-verified

360 * @returns {Promise<ModuleId[]>} result of fn
361 */
362 function waitForBlockingPromises(fn) {
363 if (blockingPromises === 0) return fn();
364 return /** @type {Promise<ModuleId[]>} */ (
365 new Promise(function (resolve) {
366 blockingPromisesWaiting.push(function () {
367 resolve(fn());
368 });
369 })
370 );
371 }
372
373 /**
374 * @param {boolean | ApplyOptions=} applyOnUpdate apply the update right away

Callers 1

hotCheckFunction · 0.85

Calls 3

resolveFunction · 0.85
fnFunction · 0.70
pushMethod · 0.45

Tested by

no test coverage detected