StateSnapshot
A component instance's full state at one point in time — the value every render-target and transport in this package passes around instead of a live component object, since components themselves are stateless between calls (see {@see \Milpa\Live\Contracts\Component\ComponentDefinitionInterface}). `$data` and `$meta` are conventionally distinguished as: `$data` is the component's primary, user-mutable value(s); `$meta` is configuration/ display state set at mount time (labels, flags, options) that {@see \Milpa\Live\Contracts\Component\ComponentDefinitionInterface::handle()} does not normally rewrite. Nothing in this class enforces that split — it is a convention components and renderers follow.
StateSnapshot::__construct()
public function __construct(string $componentId, string $componentName, string $version, array $data = [], array $meta = []):Parameters
| Name | Type | Description |
|---|---|---|
| $componentId | string | The component instance's unique id. |
| $componentName | string | The component's registered name (its {@see ComponentContract::$name}). |
| $version | string | The contract version this snapshot was mounted under (its {@see ComponentContract::$contractVersion}). |
| $data | array<string, mixed> | Primary, user-mutable state. |
| $meta | array<string, mixed> | Mount-time configuration/display state. |