MCPcopy Create free account
hub / github.com/SkalskiP/make-sense / ImageRepository

Class ImageRepository

src/logic/imageRepository/ImageRepository.ts:5–21  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3export type ImageMap = { [s: string]: HTMLImageElement; };
4
5export class ImageRepository {
6 private static repository: ImageMap = {};
7
8 public static storeImage(id: string, image: HTMLImageElement) {
9 ImageRepository.repository[id] = image;
10 }
11
12 public static storeImages(ids: string[], images: HTMLImageElement[]) {
13 zip(ids, images).forEach((pair: [string, HTMLImageElement]) => {
14 ImageRepository.storeImage(...pair);
15 })
16 }
17
18 public static getById(uuid: string): HTMLImageElement {
19 return ImageRepository.repository[uuid];
20 }
21}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected