Skip to main content
Version: v3.1.0

proxy.get

Type: ProxyGetEvent

Fired when a property is accessed on a proxy object.

Data Properties

target

Traceable

The underlying target object.

property

ObjectKey

The name or symbol of the property being accessed on the object.

result

unknown

The value that was retrieved when accessing the property. If the proxy was created without a target object, this defaults to a new proxy instance.

Example

import { Nexo } from "nexos";
import type * as nx from "nexos";

const nexo = new Nexo();
const proxy = nexo.create({ greeting: "hello" });

nexo.on("proxy.get", (event: nx.ProxyGetEvent) => {
console.log(`Accessed property: ${event.data.property}`);
});

console.log(proxy.greeting); // Logs: Accessed property: greeting