Propagation and Flow
Events in Qite move through explicit parent-child relationships. There is no global event bus and no hidden broadcasting. Understanding this flow is important when building larger component trees.
Basic propagation
When a component publishes an event:
-
It is first delivered to itself (if it listens using
"self"). - Then delivered to its parent.
- Then parent may publish another event upward if needed.
Events do not skip levels and they do not automatically travel across the entire tree.
Example: device control panel
Imagine a control panel managing several IoT devices.
class DevicePanelComponent extends BaseComponent {
constructor(tree_node) {
super(tree_node);
this.events.add([
["toggle", ">device_switch", (data) => {
this.handleToggle(data.device_id, data.enabled);
}]
]);
}
}
Each
device_switch
child component publishes a
"toggle"
event when
its internal state changes. The panel does not listen to DOM events inside
device_switch. It listens only to the domain-level
"toggle"
signal
emitted by the child.
Self-delivery
If a component publishes an event and also listens using
"self",
the handler will run immediately before the event travels upward.
this.events.add([
["refresh", "self", () => this.loadTelemetry()]
]);
this.events.publish("refresh");
This pattern is sometimes useful for internal orchestration, but should be used intentionally.
No implicit broadcasting
Publishing an event does not automatically notify siblings or distant components — only the parent receives it by default. If a parent wants to inform its own parent, it must publish another event. Event flow is always explicit.