listenOn method

StreamSubscription<T?> listenOn(
  1. WidgetModel listener, {
  2. void onValue(
    1. T? value
    )?,
  3. void onError(
    1. Object error
    )?,
})

Listen on specifited listener with possibility to add callbacks

Implementation

StreamSubscription<T?> listenOn(
  WidgetModel listener, {
  void Function(T? value)? onValue,
  void Function(Object error)? onError,
}) {
  return listener.subscribe<T>(this, onValue ?? (_) {}, onError: onError);
}