Skip to content
docsv0.1.0

ComponentMountedEvent

POST event: a component finished mounting. Dispatched as `component.mounted` — pure notification, readonly, no slot; only fires once {@see \Milpa\Live\Contracts\Component\ComponentDefinitionInterface::mount()} has returned a {@see StateSnapshot} successfully. An exception thrown during mount (e.g. autocomplete's "requires a non-empty source" guard) means this event never fires for that call — {@see ComponentMountingEvent} still fired first, unconditionally.

ComponentMountedEvent::__construct()

public function __construct(string $componentName, array $props, Milpa\Live\ValueObjects\ComponentContext $context, Milpa\Live\ValueObjects\StateSnapshot $state):

Parameters

Parameters of __construct()
NameTypeDescription
$componentNamestringThe component contract's registered name.
$propsarray<string, mixed>The mount-time props that were used.
$contextComponentContextThe ambient context `mount()` was called with.
$stateStateSnapshotThe freshly-mounted state.