Options
All
  • Public
  • Public/Protected
  • All
Menu

Class SimpleEvent<Argument>

An event which can be subscribed to and dispatched

Type parameters

  • Argument

Hierarchy

  • SimpleEvent

Index

Constructors

Methods

Constructors

constructor

Methods

asEvent

dispatch

  • dispatch(arg: Argument): void
  • Dispatches an event, calling all listeners.

    Parameters

    • arg: Argument

      the argument to call listeners with.

    Returns void

one

  • one(listener: function): void
  • Subscribes to the event only once.

    Parameters

    • listener: function

      The listener which will be called when the event is dispatched.

        • (arg: Argument): void
        • Parameters

          • arg: Argument

          Returns void

    Returns void

sub

  • sub(listener: function): void
  • Subscribe to the event.

    Parameters

    • listener: function

      The listener which will be called when the event is dispatched.

        • (arg: Argument): void
        • Parameters

          • arg: Argument

          Returns void

    Returns void

unsub

  • unsub(listener: function): void
  • Unsubscribe from the event.

    Parameters

    • listener: function

      The listener to remove.

        • (arg: Argument): void
        • Parameters

          • arg: Argument

          Returns void

    Returns void

Generated using TypeDoc