API reference
Every public class, method, and event in @codexo/exojs. Generated from source.
interfaceCacheContext
The operations a CachePolicy may perform on one acquisition. Deliberately narrow. A policy decides ORDERING - read before fetch, fetch before read, never one of them - and nothing else. It is given no asset type, no factory, no codec and no store handle, so it cannot reach into how a representation is produced, laid out or persisted. ## Failure contract - read resolves to a miss when no configured store held the record, and rejects when a store could not answer and no later store supplied the value. Every individual store failure is also reported to the loader's cache diagnostics before it is raised here, so a policy that chooses to degrade does not make the failure invisible. - write rejects when any configured store refused the write, after attempting all of them. - fetch rejects with an `AssetNetworkError` for a transport or HTTP failure, with the platform `AbortError` for a cancelled load, and with whatever the codec threw for a representation it could not read. A policy that falls back on network failure must narrow on the first of those - an unreadable response and a cancelled load are not reasons to serve stale data.
import { CacheContext } from '@codexo/exojs'The operations a CachePolicy may perform on one acquisition.
Deliberately narrow. A policy decides ORDERING - read before fetch, fetch before read, never one of them - and nothing else. It is given no asset type, no factory, no codec and no store handle, so it cannot reach into how a representation is produced, laid out or persisted.
## Failure contract
- read resolves to a miss when no configured store held the record, and rejects when a store could not answer and no later store supplied the value. Every individual store failure is also reported to the loader's cache diagnostics before it is raised here, so a policy that chooses to degrade does not make the failure invisible. - write rejects when any configured store refused the write, after attempting all of them. - fetch rejects with an `AssetNetworkError` for a transport or HTTP failure, with the platform `AbortError` for a cancelled load, and with whatever the codec threw for a representation it could not read. A policy that falls back on network failure must narrow on the first of those - an unreadable response and a cancelled load are not reasons to serve stale data.
fetch(): Promise<T>write(value: T): Promise<void>namespace: stringsignal?: AbortSignalsourceKey: string