Menu

Important: This documentation is about an older version. It's relevant only to the release noted, many of the features and functions have been updated or replaced. Please view the current version.

Enterprise Open source

LegacyEmitter interface

Signature

typescript
export interface LegacyEmitter 

Import

typescript
import { LegacyEmitter } from '@grafana/data';

Methods

MethodDescription
emit(event, payload)
off(event, handler)
on(event, handler, scope)

emit method

Signature

typescript
emit<T>(event: AppEvent<T> | string, payload?: T): void;

Parameters

ParameterTypeDescription
eventAppEvent<T> | string
payloadT

Returns:

void

off method

Signature

typescript
off<T>(event: AppEvent<T> | string, handler: (payload?: T | any) => void): void;

Parameters

ParameterTypeDescription
eventAppEvent<T> | string
handler(payload?: T | any) => void

Returns:

void

on method

Signature

typescript
on<T>(event: AppEvent<T> | string, handler: LegacyEventHandler<T>, scope?: any): void;

Parameters

ParameterTypeDescription
eventAppEvent<T> | string
handlerLegacyEventHandler<T>
scopeany

Returns:

void