Computed<T> constructor

Computed<T>(
  1. T getter(), {
  2. EqualFn? equals,
  3. JoltDebugOption? debug,
})

Creates a new computed value with the given getter function.

Parameters:

  • getter: Function that computes the value based on dependencies
  • debug: Optional debug options

Example:

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

Implementation

factory Computed(
  T Function() getter, {
  EqualFn? equals,
  JoltDebugOption? debug,
}) = ComputedImpl;