LuciadRIA (2026.0.07)
    Preparing search index...

    A utility class for objects that emit events and allow listeners to be registered.

    EventedSupport can be used in a class’s prototype chain to wire in an event notification system. For example, you can implement a custom Store and use EventedSupport to emit store-specific events.

    Implements

    Constructors

    Methods

    Constructors

    • Constructs a utility that allows emitting events and registering event handlers.

      Parameters

      • OptionalsupportedEvents: string[]

        The list of event names that can be emitted

      • OptionalstrictMode: boolean

        if true, any attempt to register a handler for an event not included in supportedEvents will throw an error.

      Returns EventedSupport

    Methods

    • Emits an event. Invokes all registered callbacks for the specified event type. Any additional parameters passed to this method are forwarded as arguments to the registered callback functions.

      Parameters

      • event: string

        the event type to emit

      • ...args: any[]

        additional parameters that describe the emitted event

      Returns void

    • Registers a callback function for a given event type.

      Parameters

      • event: string

        the event type to register on

      • callback: (...args: any[]) => void

        the callback function to register

      • Optionalcontext: any

        the context in which the callback function should be invoked implementation dependent.

      Returns Handle

      a handle to the registered callback with a single function 'remove'. This function can be used to unregister the callback function.

    • Registers a callback function on the specified target object for a given event type.

      Parameters

      • target: Evented

        the target object

      • event: string

        the event type to register on

      • callback: () => void

        the callback function to register

      • Optionalcontext: any

        the context in which the callback function should be invoked implementation dependent.

      Returns Handle

      a handle to the registered callback with a single function 'remove'. This function can be used to unregister the callback function.

    • Registers a callback function on the specified target object for a given event type. This function behaves identical to 'on' with the exception that the registered callback function will be automatically removed when it has been triggered one time.

      Parameters

      • target: Evented

        the target object

      • event: string

        the event type to register on

      • callback: () => void

        the callback function to register

      • Optionalcontext: any

        the context in which the callback function should be invoked implementation dependent.

      Returns Handle

      a handle to the registered callback with a single function 'remove'. This function can be used to unregister the callback function.