Skip to content

IReactiveObjectStateSlot interface

Defined in

Namespace: ReactiveUI.Reactive Assembly: ReactiveUI.Reactive.dll Full name: ReactiveUI.Reactive.IReactiveObjectStateSlot Modifiers: public abstract

Summary

Exposes a single storage slot on a reactive object so IReactiveObjectExtensions can keep that object's notification state (change/changing/exception subjects, suppression counters) on the instance itself rather than in a process-wide ConditionalWeakTable. This removes a per-notification table lookup and the associated allocations on the hot path.

Applies to

net10.0, net10.0-maccatalyst26.0, net10.0-desktop1.0, net10.0-browserwasm1.0, net10.0-tvos26.0, net10.0-windows10.0.19041, net10.0-macos26.0, net10.0-ios26.0, net10.0-android36.0, net9.0, net9.0-tvos18.0, net9.0-macos15.0, net9.0-maccatalyst18.0, net9.0-windows10.0.19041, net9.0-ios18.0, net9.0-desktop1.0, net8.0, net8.0-windows10.0.19041, net8.0-ios18.0, net8.0-maccatalyst18.0, net8.0-macos15.0, net8.0-tvos18.0, net8.0-ios17.5, net8.0-maccatalyst17.5, net8.0-macos14.5, netstandard2.1, net481, net462, net471

Remarks

ReactiveObject and the platform UI base types implement this (explicitly, so it stays off their public surface). Hand-rolled IReactiveObject implementers are not required to: those without a slot transparently fall back to the table, so this is a performance opt-in and not a breaking requirement.

The slot holds an opaque framework-internal object; consumers must not read or write it directly. A reference is returned so the framework can initialize it atomically on first access.

Methods

NameSummary
GetReactiveStateSlotReturns a reference to this object's single reactive notification-state slot. The framework uses the reference to lazily and atomically initialize the slot; the stored value is...