vapor-chamber API reference - v1.16.0
    Preparing search index...

    Function setCommandBus

    • Replace the shared bus instance.

      SSR WARNING: the shared bus is a module global — one per Node process, not per request. The set-render-reset pattern (see ssr.ts) is only safe when requests render strictly one at a time. Under CONCURRENT SSR renders, interleaved requests stomp each other's bus: handlers and state leak across requests. For concurrent servers, don't use the shared bus on the server — create a bus per request and pass it explicitly (every composable and plugin accepts a bus option / argument).

      Accepts either bus flavor — the composables' dispatch path already handles thenable results (runDispatch awaits them), so an AsyncCommandBus works at runtime; previously callers had to cast. getCommandBus()'s static type stays CommandBus for compatibility.

      Returns void