WritableComputedImpl<T> constructor

WritableComputedImpl<T>(
  1. T getter(),
  2. void setter(
    1. T
    ), {
  3. JoltDebugFn? onDebug,
})

Creates a new writable computed value.

Parameters:

  • getter: Function that computes the value from dependencies
  • setter: Function called when the computed value is set
  • onDebug: Optional debug callback for reactive system debugging

Example:

final count = Signal(0);
final doubleCount = WritableComputed(
  () => count.value * 2,
  (value) => count.value = value ~/ 2,
);

Implementation

WritableComputedImpl(super.getter, this.setter, {super.onDebug});