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

    Type Alias SerializeOptions

    type SerializeOptions = {
        key?: (cmd: Command) => string | number | null | undefined;
        actions?: string[];
        scope?: "instance" | "cross-tab";
        lockPrefix?: string;
    }
    Index
    key?: (cmd: Command) => string | number | null | undefined

    Derive the serialization key from a command. Commands resolving to the SAME key run strictly one-at-a-time (FIFO); different keys run concurrently. Return null/undefined to skip serialization for that command. Default: cmd.action (each action serialized against itself).

    actions?: string[]

    Restrict to specific actions (glob patterns). Default: all.

    scope?: "instance" | "cross-tab"

    Where the serialization lane lives.

    • 'instance' (default): a per-bus in-memory FIFO queue. Same-key commands serialize within THIS bus instance only.
    • 'cross-tab': use the Web Locks API (navigator.locks) so same-key commands serialize across every tab / window of the same origin — true browser-arbitrated mutual exclusion, no custom transport. Automatically falls back to the 'instance' queue when navigator.locks is unavailable (SSR, older browsers, or workers without the API).
    lockPrefix?: string

    Web Locks name prefix used in 'cross-tab' mode. Default: 'vapor-chamber:serialize'.