map<R> method
Transforms the items emitted by the source ReactiveSubject by applying a function to each item.
Usage:
final subject = ReactiveSubject<int>(initialValue: 1);
final doubled = subject.map((i) => i * 2);
doubled.stream.listen(print); // Prints: 2
subject.add(2); // Prints: 4
Implementation
ReactiveSubject<R> map<R>(R Function(T event) mapper) {
final result = ReactiveSubject<R>();
stream.map(mapper).listen(result.add, onError: result.addError);
return result;
}