watch<T> method

ZenWorkerHandle watch<T>(
  1. ValueNotifier<T> observable,
  2. void callback(
    1. T
    ), {
  3. WorkerType type = WorkerType.ever,
  4. Duration? duration,
  5. bool condition(
    1. T
    )?,
})

Create workers that auto-dispose with controller

Implementation

ZenWorkerHandle watch<T>(
  ValueNotifier<T> observable,
  void Function(T) callback, {
  WorkerType type = WorkerType.ever,
  Duration? duration,
  bool Function(T)? condition,
}) {
  return _createWorker(
      () => ZenWorkers.watch<T>(
            observable,
            callback,
            type: type,
            duration: duration,
            condition: condition,
          ),
      'watch');
}