value property

  1. @override
T get value
inherited

The current state of the reactive object.

Reading this property automatically registers the object as a dependency for the active observer (e.g., inside an LxComputed or LWatch build).

Implementation

@override
T get value {
  if (_LevitReactiveCore._fastPath) return _value;

  final proxy = _LevitReactiveCore.proxy;
  if (proxy != null) {
    _reportRead(proxy);
  } else if (_LevitReactiveCore._asyncZoneDepth > 0) {
    final zoneTracker =
        Zone.current[_LevitReactiveCore.asyncComputedTrackerZoneKey];
    if (zoneTracker is LevitReactiveObserver) {
      _reportRead(zoneTracker);
    }
  }
  return _value;
}
set value (T val)

Updates the value and triggers notifications if the value changed.

Implementation

set value(T val) => setValueInternal(val);