Diorama

Made for a big screen.

This site is one 3D scene, built for a computer: a wide window and a mouse. Open dioramajs.dev on a desktop or a laptop to see it.This site is one 3D scene, built for a wide window. Make this one wider, or open dioramajs.dev on a larger screen.

GitHub

DioramaDocs

Asset interface

A lease, returned synchronously.

View as Markdown
import type { Asset } from '@dioramajs/diorama/assets'

The entry lives while any lease does. Calling it releases it. E is the failure type, AssetError for load() and whatever make threw for acquire().

Asset(): void

Members

NameTypeDescription
readonly errorE | undefined

The failure while the lease is failed.

readonly keystring

Cache key: type, URL, CORS mode and options.

readonly readyPromise<T>

Rejects with E, or with an unreported ASSET_ABORTED if released before ready.

readonly statusReadonlySignal<AssetStatus>

State of the lease.

readonly urlstring

Absolute URL.

readonly valueT | undefined

The value while the lease is ready, undefined before and after.

dispose
dispose(): void

Same as release, so ctx.onDispose(asset) ties it to an effect.

release
release(): void

Releases the lease. The entry goes when its last lease does.

Also exported from @dioramajs/assets.

Defined in packages/assets/src/types.ts.