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.
LegacyEmitter interface
Signature
export interface LegacyEmitter
Import
import { LegacyEmitter } from '@grafana/data';
Methods
Method | Description |
---|---|
emit(event, payload) | |
off(event, handler) | |
on(event, handler, scope) |
emit method
Signature
emit<T>(event: AppEvent<T> | string, payload?: T): void;
Parameters
Parameter | Type | Description |
---|---|---|
event | AppEvent<T> | string | |
payload | T |
Returns:
void
off method
Signature
off<T>(event: AppEvent<T> | string, handler: (payload?: T | any) => void): void;
Parameters
Parameter | Type | Description |
---|---|---|
event | AppEvent<T> | string | |
handler | (payload?: T | any) => void |
Returns:
void
on method
Signature
on<T>(event: AppEvent<T> | string, handler: LegacyEventHandler<T>, scope?: any): void;
Parameters
Parameter | Type | Description |
---|---|---|
event | AppEvent<T> | string | |
handler | LegacyEventHandler<T> | |
scope | any |
Returns:
void