Advanced

Plain object property observation

How rs-x tracks plain object fields with descriptor patching, nested value proxying, and lifecycle-safe teardown.

Detailed notes

  • NonIterableObjectPropertyObserverProxyPairFactory is selected for non-collection, non-Date, non-method string properties.
  • This factory extends IndexObserverProxyPairFactory, so it can observe the property value itself and also rebind nested observers when the value changes.
  • Descriptor patching is done by ObjectPropertyObserverManager through PropertObserver, with different behavior for fields, methods, and writable accessors.
  • Readonly accessor-only properties are rejected and throw InvalidOperationException.
  • Emitted changes include chain + setValue so state can propagate and rebind cleanly.
  • On dispose, the original descriptor is restored and proxied values are unwrapped back to raw targets.