Home Reference Source
import {Events} from 'cables-shared-client'
public class | source

Events

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public

off: *

public

on: *

Private Members
private
private
private

_log: *

private

_logEvents: boolean

private

_logName: string

Method Summary

Public Methods
public

addEventListener(which: *, cb: *, idPrefix: string): string

add event listener

public

emitEvent(which: string, param1: *, param2: *, param3: *, param4: *, param5: *, param6: *)

emit event

public

hasEventListener(id: *, cb: *): boolean

check event listener registration

public

hasListenerForEventName(eventName: *): boolean

check event listener by name

public

logEvents(enabled: boolean, logName: string)

enable/disable logging of events for the class

public

removeEventListener(id: *, cb: *)

rempve event listener registration

Public Constructors

public constructor() source

Public Members

public off: * source

public on: * source

Private Members

private _eventCallbacks: {} source

private _listeners: {} source

private _log: * source

private _logEvents: boolean source

private _logName: string source

Public Methods

public addEventListener(which: *, cb: *, idPrefix: string): string source

add event listener

Params:

NameTypeAttributeDescription
which *

event name

cb *

callback

idPrefix string

prefix for id, default empty

Return:

string

event id

public emitEvent(which: string, param1: *, param2: *, param3: *, param4: *, param5: *, param6: *) source

emit event

Params:

NameTypeAttributeDescription
which string

event name

param1 *
param2 *
param3 *
param4 *
param5 *
param6 *

public hasEventListener(id: *, cb: *): boolean source

check event listener registration

Params:

NameTypeAttributeDescription
id *

event id

cb *

callback - deprecated

Return:

boolean

public hasListenerForEventName(eventName: *): boolean source

check event listener by name

Params:

NameTypeAttributeDescription
eventName *

event name

Return:

boolean

public logEvents(enabled: boolean, logName: string) source

enable/disable logging of events for the class

Params:

NameTypeAttributeDescription
enabled boolean
logName string

public removeEventListener(id: *, cb: *) source

rempve event listener registration

Params:

NameTypeAttributeDescription
id *

event id

cb *

callback - deprecated