import { RelayMetrics } from "."; import { DexieTableLike, FeedCache } from "@snort/shared"; export class RelayMetricCache extends FeedCache { constructor(table?: DexieTableLike) { super("RelayMetrics", table); } key(of: RelayMetrics): string { return of.addr; } override async preload(): Promise { await super.preload(); // load everything await this.buffer([...this.onTable]); } takeSnapshot(): Array { return [...this.cache.values()]; } }