ComputedImpl<T> constructor

ComputedImpl<T>(
  1. T getter(), {
  2. JoltDebugFn? onDebug,
})

Creates a new computed value with the given getter function.

Parameters:

  • getter: Function that computes the value based on dependencies
  • onDebug: Optional debug callback for reactive system debugging

Example:

final count = Signal(0);
final doubled = Computed(() => count.value * 2);
final expensive = Computed(() => heavyCalculation(count.value));

Implementation

ComputedImpl(
  super.getter, {
  JoltDebugFn? onDebug,
}) : super(flags: ReactiveFlags.none) {
  JoltDebug.create(this, onDebug);
}