Skip to content

Function: getPlayViewContext()

API / @xmachines/play-svelte / getPlayViewContext

function getPlayViewContext(): ViewContextValue;

Defined in: packages/play-svelte/src/actor-context.svelte.ts:69

Returns the current view context of the nearest ActorProvider ancestor.

Returns

ViewContextValue

Throws

When the caller is outside or

Read a field where you use it, and destructure it not. Every field of the return value is a GETTER over the live context of the provider, so const { spec } = getPlayViewContext() freezes at the first read and the screen stops following the actor — with no error and no warning. play-vue and play-solid hold the same rule, for the same reason.