Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1352)

Unified Diff: sdk/lib/async/stream.dart

Issue 1528363002: Update documentation on Stream.map (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Address comments. Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/async/stream.dart
diff --git a/sdk/lib/async/stream.dart b/sdk/lib/async/stream.dart
index dff5b18f984c28548898c94bc96448666331c02a..e3f3aa471074b4548a5f545f89b65e5c7a791cfb 100644
--- a/sdk/lib/async/stream.dart
+++ b/sdk/lib/async/stream.dart
@@ -313,9 +313,17 @@ abstract class Stream<T> {
* Creates a new stream that converts each element of this stream
* to a new value using the [convert] function.
*
+ * For each data event, `o`, in this stream, the returned stream
+ * provides a data event with the value `convert(o)`.
+ * If [convert] throws, the returned stream reports the exception as an error
+ * event instead.
+ *
+ * Error and done events are passed through unchanged to the returned stream.
+ *
* The returned stream is a broadcast stream if this stream is.
+ * The [convert] function is called once per data event per listener.
* If a broadcast stream is listened to more than once, each subscription
- * will individually execute `map` for each event.
+ * will individually call [convert] on each data event.
*/
Stream/*<S>*/ map/*<S>*/(/*=S*/ convert(T event)) {
return new _MapStream<T, dynamic/*=S*/>(this, convert);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698