addListener method

StreamxxListener_c<T> addListener(
  1. void onActive(
    1. T value,
    2. bool? hasModify
    ), {
  2. bool hasModify(
    1. T oldData,
    2. T newData
    )?,
  3. bool onlyNotifyWhenModify = true,
})

Implementation

StreamxxListener_c<T> addListener(
  void Function(T value, bool? hasModify) onActive, {
  bool Function(T oldData, T newData)? hasModify,
  bool onlyNotifyWhenModify = true,
}) {
  final item = StreamxxListener_c<T>(
    id: _useId++,
    onActive: onActive,
    hasModify: hasModify,
    onlyNotifyWhenModify: onlyNotifyWhenModify,
    stream: this,
  );
  _listeners.add(item);
  return item;
}