ComputedEqualsFn typedef

ComputedEqualsFn = bool Function(dynamic value, dynamic previous)

Compares a computed result with its previous value for equality.

Return true when the values should be treated as equal so downstream nodes can skip notification. The value argument is the newly computed value. The previous argument is the cached value from the prior run, or null on the first run.

Example:

final len = Computed(
  () => items.value.length,
  equals: (value, previous) => value == previous,
);

Implementation

typedef ComputedEqualsFn = bool Function(dynamic value, dynamic previous);