LxAsyncComputed<T> constructor

LxAsyncComputed<T>(
  1. Future<T> _compute(), {
  2. bool equals(
    1. T previous,
    2. T current
    )?,
  3. bool showWaiting = false,
  4. bool staticDeps = false,
  5. T? initial,
  6. String? name,
})

Base constructor for async computed values.

Implementation

LxAsyncComputed(
  this._compute, {
  bool Function(T previous, T current)? equals,
  bool showWaiting = false,
  bool staticDeps = false,
  T? initial,
  String? name,
})  : _equals = equals ?? ((a, b) => a == b),
      _showWaiting = showWaiting,
      _staticDeps = staticDeps,
      _lastComputedValue = initial,
      _hasValue = initial != null,
      super(
        initial != null ? LxSuccess<T>(initial) : LxWaiting<T>(),
        name: name,
      );