Skip to content
docsv0.1.0

InteractionRequest

A client-originated action against a mounted component, as dispatched to {@see \Milpa\Live\Contracts\Component\ComponentDefinitionInterface::handle()}. `$state` is the component's state as the caller currently trusts it — for the HTTP live loop specifically, that trust comes from the state envelope's signature having already been verified before this request is constructed, not from anything in this value object itself.

InteractionRequest::__construct()

public function __construct(string $componentId, string $componentName, string $action, Milpa\Live\ValueObjects\StateSnapshot $state, array $payload = [], array $meta = []):

Parameters

Parameters of __construct()
NameTypeDescription
$componentIdstringThe component instance's id; MUST match `$state->componentId`.
$componentNamestringThe component's registered name; MUST match `$state->componentName`.
$actionstringThe action name, as declared in the component's {@see ComponentContract::$actions}.
$stateStateSnapshotThe component's state immediately before this action is applied.
$payloadarray<string, mixed>Action-specific input data (e.g. a form field's new value).
$metaarray<string, mixed>Caller-defined extra context beyond the fields above.