API Reference

IProxyRegistry

Shared in-memory registry that stores target/proxy pairs and lets rs-x move between wrapped and unwrapped references.

Interface: IProxyRegistry

Description

This registry keeps track of original objects and their proxies.

Core services use it to avoid double-wrapping and to recover the original object when needed (for example in deep-clone flows).

Parameters

proxyTargetunknown

Original (non-proxy) object used as registry lookup key.

proxyunknown

Proxy instance associated with proxyTarget.

objectunknown

Value checked by isProxy(...) to determine whether it is a registered proxy.

Return type

getProxy<T> returns the registered proxy as T.

getProxyTarget<T> returns the original target as T.

isProxy returns boolean; register/unregister return void.

Usage notes

Use register(target, proxy) to add or replace a mapping. Use getProxy(target) to read the proxy and getProxyTarget(proxy) to get the original target back.

isProxy(value) checks whether a value is currently registered as a proxy. unregister(target) removes a mapping.

In the default setup, IProxyRegistry resolves to ProxyRegistry as a singleton service in RsXCoreModule. The registry is memory-only and is not persisted.