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.
Extended by
Section titled “Extended by”Type Parameters
Section titled “Type Parameters”F
D = unknown
Methods
Section titled “Methods”isCached()
Section titled “isCached()”isCached(
focus):boolean
Defined in: scene/source.ts:19
Whether loadScene(focus) would resolve from cache, without itself triggering a load.
Parameters
Section titled “Parameters”F | null
Returns
Section titled “Returns”boolean
keyOf()
Section titled “keyOf()”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.
Parameters
Section titled “Parameters”F | null
Returns
Section titled “Returns”string
loadScene()
Section titled “loadScene()”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.
Parameters
Section titled “Parameters”F | null
Returns
Section titled “Returns”Promise<ExplorerScene<F, D>>
loadSceneStreaming()?
Section titled “loadSceneStreaming()?”
optionalloadSceneStreaming(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.
Parameters
Section titled “Parameters”F
onUpdate
Section titled “onUpdate”(scene) => void
Returns
Section titled “Returns”Promise<ExplorerScene<F, D>>
parentOf()
Section titled “parentOf()”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.
Parameters
Section titled “Parameters”F
current
Section titled “current”ExplorerScene<F, D>
Returns
Section titled “Returns”Promise<ParentLink<F>>
refreshScene()?
Section titled “refreshScene()?”
optionalrefreshScene(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.
Parameters
Section titled “Parameters”F | null
Returns
Section titled “Returns”Promise<ExplorerScene<F, D>>
subscribeToInvalidation()?
Section titled “subscribeToInvalidation()?”
optionalsubscribeToInvalidation(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.
Parameters
Section titled “Parameters”onChange
Section titled “onChange”() => void
Returns
Section titled “Returns”() => void