@ac-essentials/misc-util
    Preparing search index...

    Class Event<T>

    An event that can be emitted with data of type T and waited upon.

    const event = new Event<number>();

    // Subscriber
    event.subscribe((data) => {
    console.log("Event received with data:", data);
    });

    // Emitter
    event.emit(42);

    // Waiter
    const data = await event.wait();
    console.log("Waited event received with data:", data);

    Type Parameters

    • T

      The type of data emitted with the event.

    Hierarchy

    • EventDispatcherBase<[T]>
      • Event

    Implements

    Index

    Constructors

    • Type Parameters

      • T

        The type of data emitted with the event.

      Returns Event<T>

    Methods