* Returns promise with the data. * @template T * @param {() => Promise<T> | T} computer function to compute the value if not cached * @returns {Promise<T>} promise with the data
(computer)
| 203 | * @returns {Promise<T>} promise with the data |
| 204 | */ |
| 205 | async providePromise(computer) { |
| 206 | const cacheEntry = await this.getPromise(); |
| 207 | if (cacheEntry !== undefined) return cacheEntry; |
| 208 | const result = await computer(); |
| 209 | await this.storePromise(result); |
| 210 | return result; |
| 211 | } |
| 212 | } |
| 213 | |
| 214 | class CacheFacade { |
nothing calls this directly
no test coverage detected