Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IEventListener

An interface for listener objects that receive notifications on fired events.

see

IEvent

see

Event

Example

export class MyListener implements IEventListener {
    private onEvent(correlationId: string, event: IEvent, args: Parameters): void {
        console.log("Fired event " + event.getName());
    }
}

let event = new Event("myevent");
event.addListener(new MyListener());
event.notify("123", Parameters.fromTuples("param1", "ABC"));

// Console output: Fired event myevent

Hierarchy

  • IEventListener

Index

Methods

Methods

onEvent

  • A method called when events this listener is subscrubed to are fired.

    Parameters

    • correlationId: string

      (optional) transaction id to trace execution through call chain.

    • event: IEvent

      a fired evemt

    • args: Parameters

      event arguments.

    Returns void

Generated using TypeDoc