Skip to main content
Version: v2.2.0

proxy.set

Type: ProxySetEvent

Triggered when a value is assigned to a property on the proxy.

This event is cancelable, meaning its default behavior can be prevented. By calling event.preventDefault(), you can override or block the underlying operation. This allows you to intercept and customize how the proxy responds to this operation.

Data Properties

target

Traceable

The underlying target object.

property

ObjectKey

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

value

unknown

The new value being assigned to the specified property on the proxy.

Example

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

const nexo = new Nexo();
const proxy = nexo.create({});

nexo.on("proxy.set", (event: nx.ProxySetEvent) => {
console.log(`Set ${event.data.property} = ${event.data.value}`);
});

proxy.name = "Nexos"; // Logs: Set name = Nexos