ComputedImpl<T>.withPrevious constructor

ComputedImpl<T>.withPrevious(
  1. T getter(
    1. T?
    ), {
  2. ComputedEqualsFn? equals,
  3. JoltDebugOption? debug,
})

Implementation

factory ComputedImpl.withPrevious(
  T Function(T?) getter, {
  ComputedEqualsFn? equals,
  JoltDebugOption? debug,
}) {
  late final ComputedImpl<T> computed;
  T fn() => getter(computed.raw.value);

  computed = ComputedImpl(fn, debug: debug);
  return computed;
}