Skip to content

Interface: ViewContextValue

API / @xmachines/play-solid / ViewContextValue

Defined in: packages/play-solid/src/ActorProvider.tsx:68

The value that the ViewContext of ActorProvider provides. usePlayView() gives it inside the ActorProvider tree.

spec is a live GETTER, and not a copied value. The provider keeps the subtree across an emission that holds the viewKey, so a read of spec inside a tracking scope gives the newest spec and the Renderer reconciles in place. A read outside a tracking scope gives a snapshot that goes old: const { spec } = usePlayView() and { ...usePlayView() } both freeze on the spec of that moment. Read view.spec at the place of the use instead. The other three fields are copied values, and the provider builds the subtree again when one of them changes.

Extends

Properties

PropertyTypeDescriptionInherited fromDefined in
handlersRecord<string, ActionHandler>The action handlers, resolved against the live StateStore.BaseViewContextValue.handlerspackages/play-view/src/view-types.ts:112
registryTRegistryThe component registry, from registryResult.registry.BaseViewContextValue.registrypackages/play-view/src/view-types.ts:114
specPlaySpecThe current PlaySpec to render.BaseViewContextValue.specpackages/play-view/src/view-types.ts:110
storeStateStoreThe active StateStore. Give it to JSONUIProvider or JsonUIProvider as store, and the providers then share the state.BaseViewContextValue.storepackages/play-view/src/view-types.ts:118