Luxar Viewer API Documentation - v2026.9.22
    Preparing search index...

    Module utils/cross-layer/event-bus

    Typed pub/sub bus for cross-layer events.

    Lower layers (data, scene, input) sometimes need to push state or commands to specific UI panels โ€” performance-monitor wants FPS samples from the animation loop, data-loading-monitor wants progress updates from the data manager, dimension-sliders wants a "toggle me" trigger from the input handler. Direct imports would violate the layer order documented in CONVENTIONS.md ยง10.

    This bus is the dependency-inversion target. The event map below declares every cross-layer event; publishers emit(...) and subscribers on(...) against it with full payload typing.

    Compared to the notifier (utils/cross-layer/notifier.ts) which has a single backend and a fixed method dictionary:

    • the bus has open subscriber sets โ€” many panels can react to the same event;
    • panels can be constructed late without bootstrap-order coupling โ€” events with no listener are dropped silently;
    • per-event payload typing fails mistyped event names at the call site.
    LuxarEventMap
    TypedEventBus
    Unsubscribe
    eventBus
    createEventBus