Independent Vue bundles, synchronized customer state.
A shared command bus for cart, favorites and comparison components across bundles and tabs.
Context
Separate Vue bundles needed to notify each other about cart, comparison and favorites changes without sharing a single application instance.
Implementation
Delivered a JavaScript command bus using BroadcastChannel with a storage fallback for other tabs and CustomEvent for listeners in the same tab. Commands include updateCart, updateCompare and updateFavorites.
The API includes ignoreSelf behavior, listener unsubscribe and bus close methods so mounted components can release their subscriptions.
Validation and scope
The recorded browser check delivered updateCart with count 42 to a local listener. This verifies that local dispatch path; it does not establish coverage of every browser or cross-tab fallback combination.
The delivered architecture allows independently mounted components to react to shared events. Customer state still needs an authoritative backend; no latency or conversion improvement is claimed.