Options
All
  • Public
  • Public/Protected
  • All
Menu

Class AEventCallbackDict

Hierarchy

  • AEventCallbackDict

Index

Constructors

constructor

  • Event callback dictionary. When you add a callback, it returns a switch. If you call switch.activate() then the callback is added to the Dict. if you call switch.deactivate() then the callback is removed. deactivating it removes the record of it from the dictionary, so there is no pointer left behind in the dictionary.

    Parameters

    • Optional name: string
    • Optional callbacks: CallbacksDictType

    Returns AEventCallbackDict

Properties

callbacks

callbacks: CallbacksDictType = {}

name

name: string

Methods

addCallback

  • addCallback(callback: ((...args: any[]) => void)[] | ((...args: any[]) => void), handle?: string): AEventCallbackSwitch
  • Adds the callback and returns a callback switch, which can call activate() and deactivate() to enable/disable the callback.

    Parameters

    • callback: ((...args: any[]) => void)[] | ((...args: any[]) => void)
    • Optional handle: string

    Returns AEventCallbackSwitch

    Callback switch {{activate: activate, active: boolean, handle: string, deactivate: deactivate}}

getCallbackList

removeCallback

  • removeCallback(handle: string): void

signalEvent

  • signalEvent(...args: any[]): void

Generated using TypeDoc