where method
Filters the stream using a predicate function.
Implementation
StreamObservable<T> where(bool Function(T data) predicate) {
throwIfDisposed('filter stream');
if (_stream == null) {
throw StateError('Call listen() first before using where()');
}
final newObs = StreamObservable<T>();
final filtered = _stream!.where(predicate);
newObs.listen(filtered);
return newObs;
}