Options
All
  • Public
  • Public/Protected
  • All
Menu

Event Manager Namespace and action based multi level events management for node and web applications.

This module can be used to pass variables from system to system in a stateless environment. A part can listen to and event, and another can raise the same event. Methods can be set as chained promise calls or async.

Hierarchy

  • EventManager

Index

Constructors

constructor

Properties

Private fullTimeDelegates

fullTimeDelegates: any

Multiple times delegated methods container.

Private oneTimeDelegates

oneTimeDelegates: any

Single time delegated methods container.

Methods

addEventListener

  • addEventListener(namespace: string, action: string, delegateFunction: any, oneTime?: boolean): void
  • Add a listener method for a namespace/action layer.

    Parameters

    • namespace: string

      Namespace for the event to be listened to.

    • action: string

      Action for the event to be listened to.

    • delegateFunction: any

      Method to be called on event raise.

    • Default value oneTime: boolean = false

      Defines if the method can be called once and removed from manager, or can be called infinitely on each event raise.

    Returns void

event

  • event(namespace: string, action: string, ...args: any): void
  • Raise an event

    Parameters

    • namespace: string

      Namespace for the to be raised event.

    • action: string

      Action for the to be raised event.

    • Rest ...args: any

      Arguments that will be passed to the delegation methods for this layer.

    Returns void

removeEventListener

  • removeEventListener(namespace: string, action: string, delegateFunction: any): void
  • Remove a previously added listener to a namespace/action layer.

    Parameters

    • namespace: string

      Remove from this namespace.

    • action: string

      Remove from this action.

    • delegateFunction: any

      Method to be removed.

    Returns void

removeListener

  • removeListener(delegateFunction: any): void
  • Remove a previously added listener from all layers.

    Parameters

    • delegateFunction: any

      Method to be removed.

    Returns void

Static Private createEvent

  • createEvent(namespace: string, action: string, delegateHolder: object): void
  • Internal method, do not use directly.

    Parameters

    • namespace: string
    • action: string
    • delegateHolder: object

    Returns void

Static Private remove

  • remove(array: [], delegateFunction: any): void
  • Internal method, do not use directly.

    Parameters

    • array: []
    • delegateFunction: any

    Returns void

Static Private removeFrom

  • removeFrom(delegateHolder: any, namespace: string, action: string, delegateFunction: any): void
  • Internal method, do not use directly.

    Parameters

    • delegateHolder: any
    • namespace: string
    • action: string
    • delegateFunction: any

    Returns void

Static Private removeFromAll

  • removeFromAll(delegateHolder: any, delegateFunction: any): void
  • Internal method, do not use directly.

    Parameters

    • delegateHolder: any
    • delegateFunction: any

    Returns void

Static Private runEvent

  • runEvent(delegateHolder: any, namespace: string, action: string, ...args: any): void
  • Internal method, do not use directly.

    Parameters

    • delegateHolder: any
    • namespace: string
    • action: string
    • Rest ...args: any

    Returns void

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc