SignalsWatch<T>.fromSignals constructor

SignalsWatch<T>.fromSignals(
  1. List<ReadonlySignal> signals, {
  2. Key? key,
  3. required T combine(
    1. List values
    ),
  4. required Widget builder(
    1. T value
    ),
  5. Function? onInit,
  6. Function? onValueUpdated,
  7. Function? onAfterBuild,
  8. Function? onDispose,
  9. bool shouldRebuild(
    1. T newValue,
    2. T oldValue
    )?,
  10. bool shouldNotify(
    1. T newValue,
    2. T oldValue
    )?,
  11. bool equals(
    1. T a,
    2. T b
    )?,
  12. Duration? debounce,
  13. Duration? throttle,
  14. void onError(
    1. Object error,
    2. StackTrace stackTrace
    )?,
  15. Widget errorBuilder(
    1. Object error
    )?,
  16. Widget loadingBuilder()?,
  17. String? debugLabel,
  18. bool debugPrint = false,
})

Create a SignalsWatch from multiple signals with batch updates.

Implementation

SignalsWatch.fromSignals(
  List<ReadonlySignal<dynamic>> signals, {
  super.key,
  required T Function(List<dynamic> values) combine,
  required this.builder,
  this.onInit,
  this.onValueUpdated,
  this.onAfterBuild,
  this.onDispose,
  this.shouldRebuild,
  this.shouldNotify,
  this.equals,
  this.debounce,
  this.throttle,
  this.onError,
  this.errorBuilder,
  this.loadingBuilder,
  this.debugLabel,
  this.debugPrint = false,
})  : assert(signals.isNotEmpty, 'signals list cannot be empty'),
      assert(
        debounce == null || throttle == null,
        'Cannot use both debounce and throttle simultaneously',
      ),
      _signals = signals,
      _combine = combine,
      _signal = null,
      _read = null,
      _selector = null;