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

    Type Alias Outbox

    The object returned by createOutbox.

    type Outbox = {
        plugin: AsyncPlugin;
        install(bus: AsyncCommandBus): void;
        flush(
            bus?: AsyncCommandBus<CommandMap>,
        ): Promise<{ replayed: number; failed: number }>;
        pending: Signal<number>;
        hydrate(): Promise<void>;
        clear(): Promise<void>;
        dispose(): void;
    }
    Index
    • Replay the queue sequentially (strict FIFO). Each record is re-dispatched through the full pipeline with its ORIGINAL idempotency key stamped on cmd.meta.idempotencyKey, so the HTTP bridge sends the same Idempotency-Key the backend may have already seen. The first failed replay stops the flush — that record and everything after it stay queued. Re-entrant calls join the in-progress flush.

      Parameters

      Returns Promise<{ replayed: number; failed: number }>

    • Load the persisted queue from storage. Call once at startup, before the first flush.

      Returns Promise<void>

    • Drop every queued record (memory + storage).

      Returns Promise<void>

    • Remove the window 'online' listener. Idempotent.

      Returns void

    plugin: AsyncPlugin

    The outbox plugin. Install OUTERMOST — before idempotent() and the transport — so offline commands are captured before any wire work: bus.use(outbox.plugin, { priority: 200 }).

    pending: Signal<number>

    Reactive queue depth — bindable in templates ("3 changes pending sync").