addEventListener method

StreamSubscription<E> addEventListener(
  1. OnEvent<E> onEvent
)

Registers a new StreamSubscription that provides a CollectionEvent denoting when any elements have been added, removed, or updated in the collection.

Implementation

StreamSubscription<E> addEventListener(OnEvent<E> onEvent) {
  _eventSubscriptions.add(
    _eventNotifier.stream.asBroadcastStream().listen(onEvent),
  );

  return _eventSubscriptions.last;
}