import { ICacheItem } from './cach-service'; import { ICacheStorage } from './storage'; /** * A simple in-memory storage implementation for cache interceptor */ export class MemoryStorage implements ICacheStorage { public readonly cache = new Map(); public readonly delete = (key: string) => this.cache.delete(key); public readonly has = (key: string) => this.cache.has(key); public readonly set = (key: string, value: ICacheItem) => this.cache.set(key, value); public readonly get = (key: string) => this.cache.get(key) as T; public readonly clear = () => this.cache.clear(); }