(obj: any, path: string)
| 39 | } |
| 40 | |
| 41 | function _innerWaitForThing(obj: any, path: string): Promise<any> { |
| 42 | const timeGap = 200; |
| 43 | return new Promise((resolve, reject) => { |
| 44 | setTimeout(() => { |
| 45 | const thing = get(obj, path); |
| 46 | if (thing) { |
| 47 | return resolve(thing); |
| 48 | } |
| 49 | reject(); |
| 50 | }, timeGap); |
| 51 | }).catch(() => { |
| 52 | return _innerWaitForThing(obj, path); |
| 53 | }); |
| 54 | } |
| 55 | |
| 56 | export function waitForThing(obj: any, path: string): Promise<any> { |
| 57 | const thing = get(obj, path); |
no test coverage detected
searching dependent graphs…