(id: string, promise: Promise<Record<string, any>>)
| 20 | expiry?: number; |
| 21 | |
| 22 | constructor(id: string, promise: Promise<Record<string, any>>) { |
| 23 | this.status = Status.WAITING; |
| 24 | this.promise = promise; |
| 25 | promise.then(_ => { |
| 26 | console.log('Fetched user ID ' + id); |
| 27 | this.status = Status.DONE; |
| 28 | this.expiry = (new Date().getTime()) + (60 * 1000); |
| 29 | }).catch(reason => { |
| 30 | console.error('Failed to fetch user', reason); |
| 31 | this.status = Status.FAILED; |
| 32 | }); |
| 33 | } |
| 34 | |
| 35 | get invalid() { |
| 36 | if (this.status === Status.FAILED) |
nothing calls this directly
no outgoing calls
no test coverage detected