ComputedStore<T> constructor

ComputedStore<T>(
  1. T _compute(
    1. StoreReader watch
    ), {
  2. bool equals(
    1. T previous,
    2. T next
    )?,
})

Creates a ComputedStore with the given _compute function.

equals overrides how the new value is compared with the previous one; defaults to ==.

Implementation

ComputedStore(this._compute, {bool Function(T previous, T next)? equals})
    : _equals = equals ?? ((a, b) => a == b);