-
Notifications
You must be signed in to change notification settings - Fork 701
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
Tutorial(streams): update for Dart 2 and analayze/test code #813
Conversation
998a37a
to
4301a9a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few quibbles, but I like your changes!
|
||
<?code-excerpt "misc/lib/tutorial/stream_interface.dart (main-stream-members)" remove="/^\s*Stream/"?> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the reason for the change in order for this list of methods? (The previous order seemed intuitive to me.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I see... Getters in alpha order, then methods in alpha order. I guess that's easier to maintain.
src/_tutorials/language/streams.md
Outdated
{% endprettify %} | ||
|
||
The `distinct()` function doesn't exist on Iterable, but it could have. | ||
The `distinct()` function doesn't exist on `Iterable`, but it could have. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Switch these two sentences to match the new order.
src/_tutorials/language/streams.md
Outdated
{% endprettify %} | ||
|
||
These first seven all correspond to similar methods on Iterable | ||
These correspond to similar methods on [Iterable][] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These -> The preceding methods
src/_tutorials/language/streams.md
Outdated
A transformer has only one function, `bind()`, which can be | ||
easily implemented by an **async** function. | ||
A [StreamTransformer][] can work with that. | ||
For example, decoders like [utf8.decode()] are transformers. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't utf8.decode() be Utf8Decoder (https://api.dartlang.org/dev/2.0.0-dev.50.0/dart-convert/Utf8Decoder-class.html)? We're talking about the decoders/transformers here, not functions.
src/_tutorials/language/streams.md
Outdated
easily implemented by an **async** function. | ||
A [StreamTransformer][] can work with that. | ||
For example, decoders like [utf8.decode()] are transformers. | ||
A transformer has only one function, [bind()][], which can be |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
has -> requires
(I was trying not to make any fixes to stuff you didn't change, but it's just not true that every transformer has only one function!)
Stream<S> mapLogErrors<S, T>( | ||
Stream<T> stream, | ||
S Function(T event) convert, | ||
) async* { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice usage of async*
!
Contributes to #407, #637, #664
Staged at https://sz-www-1.firebaseapp.com/tutorials/language/streams