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

Function createValidationPromise

packages/forms/test/util.ts:13–26  ·  view source on GitHub ↗
(
  result: ValidationErrors | null,
  timeout: number,
)

Source from the content-addressed store, hash-verified

11import {of} from 'rxjs';
12
13function createValidationPromise(
14 result: ValidationErrors | null,
15 timeout: number,
16): Promise<ValidationErrors | null> {
17 return new Promise((resolve) => {
18 if (timeout == 0) {
19 resolve(result);
20 } else {
21 setTimeout(() => {
22 resolve(result);
23 }, timeout);
24 }
25 });
26}
27
28/**
29 * Returns a promise-based async validator that emits, after a delay, either:

Callers 2

asyncValidatorFunction · 0.85
simpleAsyncValidatorFunction · 0.85

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…