Skip to content

SceneSource

Defined in: scene/source.ts:10

US070 / ADR-016 A24 — what a consumer supplies so the scene stack can explore its data.

F is the consumer’s own focus type and is opaque here: nothing in scene/ or camera/ reads inside it. null always means the root scene. The stack only ever pushes and pops the scenes the camera visits, so a source over a cyclic graph is safe: nothing here walks the data.

F

D = unknown

isCached(focus): boolean

Defined in: scene/source.ts:19

Whether loadScene(focus) would resolve from cache, without itself triggering a load.

F | null

boolean


keyOf(focus): string

Defined in: scene/source.ts:12

A stable cache identity for a focus; "root" for null. Two foci with the same key are the same scene.

F | null

string


loadScene(focus): Promise<ExplorerScene<F, D>>

Defined in: scene/source.ts:14

The scene for a focus (null is the top). Called often for the same focus: cache it.

F | null

Promise<ExplorerScene<F, D>>


optional loadSceneStreaming(focus, onUpdate): Promise<ExplorerScene<F, D>>

Defined in: scene/source.ts:17

Resolves as soon as the first part of a scene is available and reports every later part via onUpdate. Optional: without it the stack waits for loadScene.

F

(scene) => void

Promise<ExplorerScene<F, D>>


parentOf(focus, current): Promise<ParentLink<F>>

Defined in: scene/source.ts:26

Where zooming out of focus leads. current is the scene for focus as it is on screen, for a source that can answer from data already in hand. A rejection leaves the camera where it was.

F

ExplorerScene<F, D>

Promise<ParentLink<F>>


optional refreshScene(focus): Promise<ExplorerScene<F, D>>

Defined in: scene/source.ts:22

Reloads a scene whose data changed underneath it. Optional: without it the stack reloads through loadScene, which may return the cached copy.

F | null

Promise<ExplorerScene<F, D>>


optional subscribeToInvalidation(onChange): () => void

Defined in: scene/source.ts:29

Calls onChange when data behind the scenes changed (a write elsewhere), so the view can refresh what is on screen. Returns an unsubscribe function. Optional.

() => void

() => void