danschultz / stream_transformers

A Dart package for transforming streams
MIT License
12 stars 9 forks source link

Add MergeAll #2

Closed danschultz closed 9 years ago

danschultz commented 9 years ago

Merges the streams of a stream into a single stream.

Example:

var source = new StreamController();

var merged = source
    .map((word) => new Stream.fromIterable(word.split(""))
    .transform(new MergeAll());

merged.listen(print);

source.add("hello"); // prints: h, e, l, l, o
source.add("world"); // prints: w, o, r, l, d