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

    Type Alias FastDispatcher<T, R>

    FastDispatcher: (data: T) => R

    vapor-chamber — fast lane.

    A minimal-allocation dispatch path for real-real-hot loops. NOT a general-purpose command bus — it deliberately strips every feature that costs per-call CPU or memory.

    Use when: • Per-frame game tick • Trading tick data (1k–100k+ msg/sec) • Audio buffer sample handling • Scroll / mousemove / pointer sampling • Physics or simulation step

    Do NOT use for general app dispatch (cart, form, navigation, analytics). Use createCommandBus() for those — its ergonomics are correct for those use cases. The fast lane intentionally drops: • Command envelope allocation (handler receives data directly) • CommandResult allocation (handler returns whatever) • Plugin chain, before/after hooks • Wildcard listeners • Schema validation, batch, request/response, AbortController • meta / id / correlation / causation tracing • Auto-cleanup hooks (no Vue scope integration)

    If you need any of the above on a per-call basis, use the regular bus.

    Type Parameters

    • T = any
    • R = any

    Type Declaration

      • (data: T): R
      • Parameters

        • data: T

        Returns R

    Single-handler hot dispatch
    const lane = createFastLane();
    const onTick = lane.compile('tick', (dt: number) => physicsStep(dt));
    onTick(deltaSeconds); // pure function call, no envelope
    Multi-subscriber pub/sub
    lane.on('frame', (dt) => animate(dt));
    lane.on('frame', (dt) => render(dt));
    lane.emit('frame', dt);