* Gets a resource by URL. Fetches and parses it if it's not available in the * store. Not recommended to use this for rendering, because it might cause * resources to be fetched multiple times.
(subject: string)
| 182 | * resources to be fetched multiple times. |
| 183 | */ |
| 184 | async getResourceAsync(subject: string): Promise<Resource> { |
| 185 | const found = this.resources.get(subject); |
| 186 | if (found == undefined) { |
| 187 | const newR = await this.fetchResource(subject); |
| 188 | return newR; |
| 189 | } |
| 190 | return found; |
| 191 | } |
| 192 | |
| 193 | /** Gets a property by URL. */ |
| 194 | async getProperty(subject: string): Promise<Property> { |
no test coverage detected