API reference

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

C

classAssetRef

@codexo/exojs / assets / stable

Deferred handle for value assets (parsed JSON, text, CSV rows, ...), returned by `loader.get(Asset.type('json', src))` / a bare value path and friends. Values cannot heal in place the way resource handles do, so the REF is the stable identity: value throws until `'ready'`, loaded resolves with the value itself, and a failed ref retries (healing in place) on the next `get`.

6
props
0
methods
0
events
Import
import { AssetRef } from '@codexo/exojs'

Deferred handle for value assets (parsed JSON, text, CSV rows, ...), returned by `loader.get(Asset.type('json', src))` / a bare value path and friends. Values cannot heal in place the way resource handles do, so the REF is the stable identity: value throws until `'ready'`, loaded resolves with the value itself, and a failed ref retries (healing in place) on the next `get`.

Constructors1
new(): AssetRef<T>
Properties6
error: Error | null
The error the last load failed with, or null outside 'failed'.
loaded: Promise<T>
Promise settling with the parsed value. Re-materialized when a failed load is retried - read it fresh from this getter across load cycles.
ready: boolean
true exactly when state is 'ready'.
value: T
The parsed value. Throws while 'loading' or 'failed' - await loaded or check loadState.
Source