MCPcopy Create free account
hub / github.com/angular/angular / flush

Function flush

packages/core/test/resource/resource_spec.ts:60–70  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

58 }
59
60 async flush(): Promise<void> {
61 const allPending = Array.from(this.pending.values()).map((pending) => pending.promise);
62
63 for (const [req, {resolve}] of this.pending) {
64 resolve(this.prepareResponse(req));
65 }
66 this.pending.clear();
67
68 await Promise.all(allPending);
69 await flushMicrotasks();
70 }
71
72 protected abstract prepareResponse(request: T): R;
73}

Callers

nothing calls this directly

Calls 8

mapMethod · 0.80
valuesMethod · 0.80
flushMicrotasksFunction · 0.70
resolveFunction · 0.50
fromMethod · 0.45
prepareResponseMethod · 0.45
clearMethod · 0.45
allMethod · 0.45

Tested by

no test coverage detected