CachedSceneSource
Defined in: scene/create-source.ts:28
A SceneSource that also lets you say its data changed.
Extends
Section titled “Extends”SceneSource<F,D>
Type Parameters
Section titled “Type Parameters”F
D = unknown
Methods
Section titled “Methods”invalidate()
Section titled “invalidate()”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.
Parameters
Section titled “Parameters”focus?
Section titled “focus?”F | null
Returns
Section titled “Returns”void
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
Inherited from
Section titled “Inherited from”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
Inherited from
Section titled “Inherited from”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>>
Inherited from
Section titled “Inherited from”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>>
Inherited from
Section titled “Inherited from”SceneSource.loadSceneStreaming
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>>
Inherited from
Section titled “Inherited from”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>>
Inherited from
Section titled “Inherited from”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