initial
[sketchy-heroes.git] / src / lib / cache.ts
1 export class Cache {
2   items: Record<string, any>;
3   constructor() {
4     this.items = {};
5   }
6
7   async put(key: string, item: any) {
8     this.items[key] = item;
9   }
10
11   async get<T>(key: string): Promise<T> {
12     return this.items[key] as T;
13   }
14 }
15
16
17 export const cache = new Cache();