Transforming Streams: map, where, take
Reshape an event sequence.
Streams Are Transformable
Just like lists, streams have handy methods that reshape their events. You can transform a stream into a new one without touching the source.
map Transforms Each Event
The map method runs a function on every event and emits the result. It turns one stream of values into a stream of transformed values.
final doubled = numbers.map((n) => n * 2);All lessons in this course
- Listening With await for
- Single vs Broadcast Streams
- Transforming Streams: map, where, take
- Creating Streams With async*