Skip to content

Function: composePlayState()

API / @xmachines/play-actor / composePlayState

function composePlayState(authoredState, slice): Record<string, unknown> | undefined;

Defined in: packages/play-actor/src/context-projection.ts:228

Composes the effective state of a view: the authored spec.state and the /context slice.

When the authored state declares the reserved key already, the function skips the projection, the authored state wins, and the code writes a warning in development. No spec that exists now therefore fails.

Parameters

ParameterTypeDescription
authoredStateRecord<string, unknown> | undefinedThe raw meta.view.state value. It can be anything, and the caller or toAtomState cleans it.
sliceRecord<string, unknown> | undefinedThe context of the machine, as one complete value.

Returns

Record<string, unknown> | undefined