@bacnet-js/device
    Preparing search index...

    Class AsyncEventEmitter<T>

    Implements an event emitter, conceptually similar to Node.js' native EventEmitter, that supports asynchronous event handlers/listeners.

    This class provides a foundation for event-based communication between BACnet components. It allows objects to register listeners for specific events and trigger those events asynchronously.

    Type Parameters

    • T extends EventMap

      An interface mapping event names to their argument arrays

    Hierarchy (View Summary)

    Implemented by

    Index

    Constructors

    Methods

    Constructors

    Methods

    • Alias for on

      Type Parameters

      • K extends string | number | symbol

      Parameters

      Returns void

    • Adds a new listener for the specified event.

      Type Parameters

      • K extends string | number | symbol

      Parameters

      • event: K

        The event name to subscribe to

      • cb: EventListener<T, K>

        The callback function to execute when the event is triggered

      Returns AsyncEventEmitter<T>

      The callback function for chaining