API Reference@grafana/dataLegacyEmitter

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