( result: ValidationErrors | null, timeout: number, )
| 11 | import {of} from 'rxjs'; |
| 12 | |
| 13 | function 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: |
no test coverage detected
searching dependent graphs…