Options
All
  • Public
  • Public/Protected
  • All
Menu

The IEventSlotOwner interface represents an event slot from the point of view of the caller who created it. The owner can fire events and clear event listeners.

Type parameters

Hierarchy

Implemented by

Index

Methods

attach

  • attach(listener: TFunc): void
  • Adds the given function as a listener to the event. Note that this cannot be a lambda function because there will be no way to remove a lambda function listener later.

    Parameters

    • listener: TFunc

    Returns void

clear

  • clear(): void
  • Removes all listeners to the event.

    Returns void

detach

  • detach(listener: TFunc): void
  • Removes the given function as a listener to the event.

    Parameters

    • listener: TFunc

    Returns void

fire

  • fire(...a: Parameters<TFunc>): void
  • Method that raises the event and calls all the listeners (if any). It has the signature of the template function so only proper-types parameters can be passed to it.

    Parameters

    • Rest ...a: Parameters<TFunc>

    Returns void

has

  • has(): boolean
  • Determines whether this event slot has any listeners.

    Returns boolean