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
| Property | Type | Description | Inherited from | Defined in |
|---|---|---|---|---|
handlers | Record<string, ActionHandler> | The action handlers, resolved against the live StateStore. | BaseViewContextValue.handlers | packages/play-view/src/view-types.ts:112 |
registry | TRegistry | The component registry, from registryResult.registry. | BaseViewContextValue.registry | packages/play-view/src/view-types.ts:114 |
spec | PlaySpec | The current PlaySpec to render. | BaseViewContextValue.spec | packages/play-view/src/view-types.ts:110 |
store | StateStore | The active StateStore. Give it to JSONUIProvider or JsonUIProvider as store, and the providers then share the state. | BaseViewContextValue.store | packages/play-view/src/view-types.ts:118 |