Home Reference Source
import EventEmitter from 'canvas-gauges/lib/EventEmitter.js'
public class | source

EventEmitter

Class EventEmitter - base event manager

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public
public get

Returns all event listeners

public

Method Summary

Public Methods
public

emit(event: string, args: ...*)

Emits given event bypassing to each registered handler given args

public

off(event: string, handlers: ...function)

Un-registers previously registered event handlers

public

on(event: string, handlers: ...function)

Registers given handlers for a given events to be called each time event is emitted

public

once(event: string, handlers: ...function)

Registers given handler for given event to be called only once when event is emitted

public

Removes all listeners for a given event

Public Constructors

public constructor source

Public Members

public addListener: * source

public get listeners: object: * source

Returns all event listeners

Return:

object

public removeListener: * source

Public Methods

public emit(event: string, args: ...*) source

Emits given event bypassing to each registered handler given args

Params:

NameTypeAttributeDescription
event string
args ...*

public off(event: string, handlers: ...function) source

Un-registers previously registered event handlers

Params:

NameTypeAttributeDescription
event string
handlers ...function

public on(event: string, handlers: ...function) source

Registers given handlers for a given events to be called each time event is emitted

Params:

NameTypeAttributeDescription
event string
handlers ...function

public once(event: string, handlers: ...function) source

Registers given handler for given event to be called only once when event is emitted

Params:

NameTypeAttributeDescription
event string
handlers ...function

public removeAllListeners(event: string) source

Removes all listeners for a given event

Params:

NameTypeAttributeDescription
event string