UNPKG

mastercache

Version:

Multi-tier cache module for Node.js. Redis, Upstash, CloudfareKV, File, in-memory and others drivers

24 lines (20 loc) 432 B
import type { CacheEvent } from '../../types/main'; /** * Event emitted when a cache entry is written * using `set`,`getOrSet` */ export class CacheWritten implements CacheEvent { name = 'cache:written' as const; constructor( readonly key: string, readonly value: any, readonly store: string, ) {} toJSON() { return { key: this.key, store: this.store, value: this.value, }; } }