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

Function waitFor

packages/core/rxjs-interop/test/rx_resource_spec.ts:461–465  ·  view source on GitHub ↗
(fn: () => boolean)

Source from the content-addressed store, hash-verified

459});
460
461async function waitFor(fn: () => boolean): Promise<void> {
462 while (!fn()) {
463 await timeout(1);
464 }
465}
466
467function flushMicrotasks(): Promise<void> {
468 return new Promise((resolve) => setTimeout(resolve, 0));

Callers 1

Calls 2

timeoutFunction · 0.90
fnFunction · 0.50

Tested by

no test coverage detected