InteractionResult
The outcome of {@see \Milpa\Live\Contracts\Component\ComponentDefinitionInterface::handle()} processing an {@see InteractionRequest}. `$state` is always the component's new state — even an action that ultimately failed MUST return the (possibly unchanged) state rather than omitting it, since callers do not treat a non-empty `$errors` as "no state to persist".
InteractionResult::__construct()
public function __construct(Milpa\Live\ValueObjects\StateSnapshot $state, ?string $html = null, array $effects = [], array $errors = [], array $meta = []):Parameters
| Name | Type | Description |
|---|---|---|
| $state | StateSnapshot | The component's state after the action was applied. |
| $html | (string | null) | Pre-rendered HTML for this result, when the component renders itself rather than leaving re-rendering to a {@see \Milpa\Live\Contracts\Rendering\ComponentRendererInterface}. |
| $effects | array<int, array<string, mixed>> | Client-side side effects to perform (e.g. `['type' => 'persist']`); shape is action/effect-type defined, not standardized here. |
| $errors | array<string, mixed> | Field/reason => human-readable message, for an action the component recognized but rejected or partially failed. |
| $meta | array<string, mixed> | Caller-defined extra context beyond the fields above. |