Skip to content

Commit

Permalink
FlatMapLatest: tweak example so it behaves as expected
Browse files Browse the repository at this point in the history
Depends on danschultz#34.
Fixes danschultz#35.
  • Loading branch information
chalin committed Jul 31, 2016
1 parent 4bb8021 commit 4678d1d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,9 @@ Similar to `FlatMap`, but instead of including events from all spawned streams,

```dart
var controller = new StreamController();
var latest = controller.stream.transform(new FlatMapLatest((value) => new Stream.fromIterable([value + 1])));
var delay0 = new Delay(new Duration(milliseconds: 0));
var latest = controller.stream.transform(new FlatMapLatest((value) =>
new Stream.fromIterable([value + 1]).transform(delay0)));
latest.listen(print);
Expand Down
4 changes: 3 additions & 1 deletion lib/src/flat_map_latest.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ part of stream_transformers;
/// **Example:**
///
/// var controller = new StreamController();
/// var latest = controller.stream.transform(new FlatMapLatest((value) => new Stream.fromIterable([value + 1])));
/// var delay0 = new Delay(new Duration(milliseconds: 0));
/// var latest = controller.stream.transform(new FlatMapLatest((value) =>
/// new Stream.fromIterable([value + 1]).transform(delay0)));
///
/// latest.listen(print);
///
Expand Down

0 comments on commit 4678d1d

Please sign in to comment.