Skip to main content
Version: v1.1.0

proxy.construct

Type: ProxyEvent

Fired when a proxy-wrapped constructor is called using new.

function Person(name) {
this.name = name;
}
const proxy = nexo.create(Person);

nexo.on("proxy.construct", (event) => {
console.log("Constructor called with:", event.data.args);
});

new proxy("Alice"); // Logs: Constructor called with: [ 'Alice' ]