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

    Type Alias FastLane

    type FastLane = {
        compile<T = any, R = any>(
            action: string,
            handler: (data: T) => R,
        ): FastDispatcher<T, R>;
        remove(action: string): void;
        on<T = any>(action: string, listener: FastListener<T>): () => void;
        emit<T = any>(action: string, data: T): void;
        registeredActions(): string[];
        clear(): void;
    }
    Index
    • Bind a handler to an action and return a pre-compiled dispatcher. The returned callable invokes the handler with no envelope, no result wrapping, no plugin chain.

      Calling compile twice for the same action overwrites the binding; the previously-returned dispatcher will route to the new handler on its next invocation (closures share the same lookup).

      Type Parameters

      • T = any
      • R = any

      Parameters

      • action: string
      • handler: (data: T) => R

      Returns FastDispatcher<T, R>

    • Remove an action's handler and any subscribers.

      Parameters

      • action: string

      Returns void

    • Subscribe to multi-listener fan-out for an action. Listeners run in registration order via a tight indexed loop.

      Type Parameters

      • T = any

      Parameters

      Returns () => void

    • Fan out an event to all subscribers. No envelope allocation; listeners receive data directly.

      Type Parameters

      • T = any

      Parameters

      • action: string
      • data: T

      Returns void

    • Diagnostic: list registered actions.

      Returns string[]