Preparing search index...

    Simple implementation of an event class. Add callbacks to be notified when the event is triggered.

    Type Parameters

    • T extends unknown[]
    Index

    Constructors

    Methods

    Constructors

    Methods

    • Add a callback function to this event. The callback function will be executed when this event is triggered.

      Parameters

      • callback: (...args: T) => void

        Callback function to execute

      Returns (...args: T) => void

      The callback passed in, can be used with remove()

    • Remove a callback function from this event.

      Parameters

      • callback: (...args: T) => void

        Callback function to remove

      Returns void

    • Trigger the event so that all callbacks are executed. All arguments given will be passed to the callbacks.

      Parameters

      • ...args: T

        Arguments to pass to callbacks

      Returns void