API reference
Every public class, method, and event in @codexo/exojs. Generated from source.
classMemoryCacheStore
CacheStore that keeps records in a `Map` for the lifetime of the process. Holds values BY REFERENCE - no cloning, no serialization - so it accepts anything at all and is as fast as a lookup, but does not isolate a caller from later mutation of a stored object and does not survive a reload. Its usual place is in front of a persistent store, where a hit avoids the asynchronous round trip: ```ts new AssetCache({ read: [new MemoryCacheStore(), idb], write: [idb], promote: true }) ```
import { MemoryCacheStore } from '@codexo/exojs'CacheStore that keeps records in a `Map` for the lifetime of the process.
Holds values BY REFERENCE - no cloning, no serialization - so it accepts anything at all and is as fast as a lookup, but does not isolate a caller from later mutation of a stored object and does not survive a reload.
Its usual place is in front of a persistent store, where a hit avoids the asynchronous round trip:
```ts new AssetCache({ read: [new MemoryCacheStore(), idb], write: [idb], promote: true }) ```
new(id: string): MemoryCacheStoreclear(namespace?: string): Promise<void>destroy(): voidget(key: CacheRecordKeyThe identity of one persisted cache record. A SourceKey alone is deliberately not enough. It carries no asset type - two types may acquire one URL and keep ent…): Promise<CacheReadResultThe outcome of reading one cache record. A miss and a failure are deliberately different things: a miss resolves to `{ hit: false }`, a store that could not an…>id: string