MCPcopy Index your code
hub / github.com/angular/angular / dynamicImportOf

Function dynamicImportOf

packages/core/test/acceptance/defer_spec.ts:83–87  ·  view source on GitHub ↗

* Emulates a dynamic import promise. * * Note: `setTimeout` is used to make `fixture.whenStable()` function * wait for promise resolution, since `whenStable()` relies on the state * of a macrotask queue.

(type: T, timeout = 0)

Source from the content-addressed store, hash-verified

81 * of a macrotask queue.
82 */
83function dynamicImportOf<T>(type: T, timeout = 0): Promise<T> {
84 return new Promise<T>((resolve) => {
85 setTimeout(() => resolve(type), timeout);
86 });
87}
88
89/**
90 * Emulates a failed dynamic import promise.

Callers 2

allPendingDynamicImportsFunction · 0.70
interceptFunction · 0.70

Calls 2

setTimeoutFunction · 0.85
resolveFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…