Skip to content

Variable: getPlayViewContext

API / @xmachines/play-vue / getPlayViewContext

const getPlayViewContext: () => ViewContextValue = usePlayView;

Defined in: packages/play-vue/src/actor-provider-context.ts:60

Access the current ViewContextValue from inside an ActorProvider tree.

Returns the current ViewContextValue inside an ActorProvider tree.

Returns

ViewContextValue

Throws

When the caller is outside an tree or a tree

Example

import { usePlayView } from "@xmachines/play-vue";
const view = usePlayView();
// view.spec, view.handlers, view.registry

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

Deprecated

Renamed to usePlayView; will be removed in the next major.