Skip to main content
Version: v1.2.0

Class: ProxyEvent<Data>

Defined in: src/events/ProxyEvent.ts:16

Represents an event triggered by a proxy. This class extends NexoEvent and adds functionality to emit the event to listeners associated with the proxy's nexo and wrapper event emitters.

Example

const proxyEvent = new ProxyEvent('get', { target: someProxyInstance, data: someData });
// This will emit the 'proxy.get' event to listeners.

Extends

Type Parameters

Data = unknown

The type of the event's data.

Constructors

new ProxyEvent()

new ProxyEvent<Data>(name, options): ProxyEvent<Data>

Defined in: src/events/ProxyEvent.ts:29

Creates an instance of the ProxyEvent. This constructor initializes the event with the name prefixed by proxy. and emits the event on the proxy's associated event emitters.

Parameters

name

ProxyHandler

The name of the proxy handler (e.g., 'get', 'set').

options

Event<Proxy, Data>

The options for the event, including the target proxy and any associated data.

Returns

ProxyEvent<Data>

Example

const proxyEvent = new ProxyEvent('get', { target: someProxyInstance, data: someData });
// This emits the 'proxy.get' event on the proxy's `nexo` emitter and its wrapper.

Overrides

NexoEvent.constructor