where method
Filters the items emitted by the source ReactiveSubject by only emitting those that satisfy a specified predicate.
Usage:
final subject = ReactiveSubject<int>(initialValue: 1);
final evens = subject.where((i) => i % 2 == 0);
evens.stream.listen(print);
subject.add(2); // Prints: 2
subject.add(3); // Does not print
Implementation
ReactiveSubject<T> where(bool Function(T event) test) {
final result = ReactiveSubject<T>();
stream.where(test).listen(result.add, onError: result.addError);
return result;
}