@kkdev92/vscode-ext-kit - v4.1.1
    Preparing search index...

    Interface Emitter<T>

    Minimal event emitter for the vscode-free core.

    Delivery iterates a snapshot of the listener set — the same contract VS Code's own EventEmitter has, and the one that is easy to get wrong: a listener disposing itself, or another, part-way through a firing must not cause anyone else to be skipped.

    Listener failures are not isolated: fire propagates the exception and does not call later listeners in that delivery. Callers that need best-effort observers must isolate them before registration.

    interface Emitter<T> {
        dispose(): void;
        event(listener: (value: T) => void): { dispose(): void };
        fire(value: T): void;
    }

    Type Parameters

    • T
    Index
    • Subscribes. The returned disposable detaches exactly this listener.

      Parameters

      • listener: (value: T) => void

      Returns { dispose(): void }