map<R> method
Transforms the stream using a mapping function.
Implementation
StreamObservable<R> map<R>(R Function(T data) mapper) {
throwIfDisposed('map stream');
if (_stream == null) {
throw StateError('Call listen() first before using map()');
}
final newObs = StreamObservable<R>();
final newStream = _stream!.map(mapper);
newObs.listen(newStream);
return newObs;
}