StreamListenableList<T> constructor

StreamListenableList<T>(
  1. Stream<T> _stream,
  2. {List<T> initial,
  3. dynamic listen(
    1. ListenableList<T>,
    2. T
    )}
)

Implementation

StreamListenableList(
  this._stream, {
  final List<T> initial,
  this.listen,
}) : super.from(initial) {
  _streamSubscription = _stream.listen(listen == null
      ? (T event) => _listen<T>(this, event)
      : (T event) => listen(this, event))
    ..onDone(_onDone);
}