Interface ProviderEventEmitter<E, AdditionalContext>

Event emitter to be optionally implemented by providers. Implemented by

OpenFeatureEventEmitter.

interface ProviderEventEmitter<E, AdditionalContext> {
    addHandler(eventType: AnyProviderEvent, handler: EventHandler<ProviderEvents | ClientProviderEvents>): void;
    emit(eventType: E, context?: EventContext<Record<string, unknown>, (ServerProviderEvents | ClientProviderEvents)>): void;
    getHandlers(eventType: AnyProviderEvent): EventHandler<ProviderEvents | ClientProviderEvents>[];
    removeAllHandlers(eventType?: AnyProviderEvent): void;
    removeHandler(eventType: AnyProviderEvent, handler: EventHandler<ProviderEvents | ClientProviderEvents>): void;
    setLogger(logger: Logger): ProviderEventEmitter<E, AdditionalContext>;
}

Type Parameters

  • E extends AnyProviderEvent
  • AdditionalContext extends Record<string, unknown> = Record<string, unknown>

Hierarchy (view full)

Implemented by

Methods