Skip to content

Function: useScope()

ts
function useScope(): WireScope;

Defined in: src/wirestate-react/context/use-scope.ts:27

Returns a WireScope instance bound to the active container.

Returns

WireScope

A WireScope instance.

Remarks

The scope is recreated if the container changes. It provides a convenient way to access container features like events, commands, and queries.

Example

tsx
const scope: WireScope = useScope();

scope.emitEvent("UI_READY");