Skip to content

CachedSceneSource

Defined in: scene/create-source.ts:28

A SceneSource that also lets you say its data changed.

F

D = unknown

invalidate(focus?): void

Defined in: scene/create-source.ts:31

Forget the cached scene for focus, or every cached scene, and have any explorer using this source reload what it shows, in place. Call it when your data changes.

F | null

void


isCached(focus): boolean

Defined in: scene/source.ts:19

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

F | null

boolean

SceneSource.isCached


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

SceneSource.keyOf


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>>

SceneSource.loadScene


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>>

SceneSource.loadSceneStreaming


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>>

SceneSource.parentOf


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>>

SceneSource.refreshScene


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

SceneSource.subscribeToInvalidation