Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FlatMapLatest: tweak example so it behaves as expected #36

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ Spawns a new stream from a function for each event in the source stream. The ret

```dart
var controller = new StreamController();
var flapMapped = controller.stream.transform(new FlatMap((value) => new Stream.fromIterable([value + 1]));
var flatMapped = controller.stream.transform(new FlatMap((value) => new Stream.fromIterable([value + 1])));

flatMapped.listen(print);

Expand All @@ -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
2 changes: 1 addition & 1 deletion lib/src/flat_map.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ part of stream_transformers;
/// **Example:**
///
/// var controller = new StreamController();
/// var flapMapped = controller.stream.transform(new FlatMap((value) => new Stream.fromIterable([value + 1]));
/// var flatMapped = controller.stream.transform(new FlatMap((value) => new Stream.fromIterable([value + 1])));
///
/// flatMapped.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