06. Cross-Component Events

The Problem

A Sales component may need to announce `InvoiceSaved` while an unrelated Dashboard component refreshes itself.

The Angular Difficulty

Angular has strong RxJS and service patterns, but a cross-component event channel normally needs a service or subject/event abstraction.

Angular Approach

private bus = inject(EventBusService);

this.bus.emit("invoiceSaved", { invoiceId: 501 });

this.bus.listen("invoiceSaved", data => {
    this.refreshDashboard(data);
});

MS Approach

ManySet provides a direct runtime-oriented approach for this recurring business-application task.

ms.ui.emit("invoiceSaved", { invoiceId: 501 });

ms.ui.listen("invoiceSaved", data => {
    refreshDashboard(data);
});

Why this way is useful in business applications :

The comparison is intended to show where ManySet supplies a business-application abstraction around a recurring task, while keeping HTML and JavaScript visible and directly usable.

Key Point :

ManySet reduces the amount of framework-specific composition required for this particular task, without requiring the React/Angular mechanism to be represented as inherently wrong or incapable.