Interface ProviderEventEmitter<E, AdditionalContext>

Event emitter to be optionally implemented by providers. Implemented by

OpenFeatureEventEmitter.

interface ProviderEventEmitter<E, AdditionalContext> {
    addHandler(eventType: AnyProviderEvent, handler: EventHandler<ServerProviderEvents | ProviderEvents>): void;
    emit(eventType: E, context?: EventContext<Record<string, unknown>, (ServerProviderEvents | ClientProviderEvents)>): void;
    getHandlers(eventType: AnyProviderEvent): EventHandler<ServerProviderEvents | ProviderEvents>[];
    removeAllHandlers(eventType?: AnyProviderEvent): void;
    removeHandler(eventType: AnyProviderEvent, handler: EventHandler<ServerProviderEvents | ProviderEvents>): 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