API reference

Every public class, method, and event in @codexo/exojs. Generated from source.

I

interfaceCacheContext

@codexo/exojs / assets / stable

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.

3
props
3
methods
0
events
Import
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.

Methods3
fetch(): Promise<T>
Acquire the representation from the network.
write(value: T): Promise<void>
Write the representation to the route's write stores.
Properties3
namespace: string
The storage namespace of the acquisition, which is the asset type's id.
signal?: AbortSignal
Cancellation signal of the load, when the caller started one with a cancellation channel.
sourceKey: string
The source identity being acquired.
Source