Change detection by value type
rs-x selects the observation strategy per runtime value type. The table below summarizes how mutation is detected and pushed into the state/change pipeline.
Recursive member observation is opt-in via IIndexWatchRule, passed either to state manager watchState(...) or as leafIndexWatchRule in rsx(...). The rule is evaluated per (index, target); when it returns true, rs-x installs nested observers/proxies and rebinds them if a member value is replaced. Without a watch rule, only root assignments/mutations are observed.
rs-x does not set up observation again on every bind. For the same observed target, it reuses the existing observation setup and tracks usage with reference counting. New binds increment the count; dispose/unbind decrements it; when the count reaches zero, rs-x tears down observation, restores patched descriptors, and writes proxified property values back to their raw (unproxified) value.
| Array | Proxy | False | Array mutations emit index-level changes; with IndexWatchRule, matching items are observed recursively. |
| Date | Proxy | False | Date setter calls emit date-part changes; with IndexWatchRule, only matching date properties are emitted. |
| Expression (AbstractExpression) | Observer (changed event) | True | When an expression value changes, the change flows through state manager so dependent expressions re-evaluate. |
| Map | Proxy | False | Map mutations emit key-level changes; with IndexWatchRule, matching entry values are observed recursively. |
| Observable | Observer (subscribe) | True | Each observable emission updates the stored value, and the change flows through state manager. |
| Plain object property | Patching | False | Property writes hit patched descriptors and emit changes; with IndexWatchRule, matching nested members are observed recursively. |
| Promise | Observer (then) | True | When a promise resolves, the resolved value is stored and the change flows through state manager. |
| Set | Proxy | False | Set membership mutations emit member-level changes; with IndexWatchRule, matching members are observed recursively. |