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

Unified Diff: lib/src/stream_zip.dart

Issue 1777453002: Modernize the package's style. (Closed) Base URL: git@github.com:dart-lang/async.git@master
Patch Set: Created 4 years, 9 months 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
Index: lib/src/stream_zip.dart
diff --git a/lib/stream_zip.dart b/lib/src/stream_zip.dart
similarity index 83%
copy from lib/stream_zip.dart
copy to lib/src/stream_zip.dart
index 055489dbd38cd5dd6eb9dc7015887ee5a8df1f12..432cc22c29d8aaed15518cd6821f3ca3bf7df788 100644
--- a/lib/stream_zip.dart
+++ b/lib/src/stream_zip.dart
@@ -1,22 +1,23 @@
-// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
+// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-/**
- * Help for combining multiple streams into a single stream.
- */
-library dart.pkg.async.stream_zip;
-
import "dart:async";
-/**
- * A stream that combines the values of other streams.
- */
-class StreamZip extends Stream<List> {
- final Iterable<Stream> _streams;
- StreamZip(Iterable<Stream> streams) : _streams = streams;
+/// A stream that combines the values of other streams.
+///
+/// This emits lists of collected values from each input stream. The first list
+/// contains the first value emitted by each stream, the second contrains the
+/// second value, and so on. The lists have the same ordering as the iterable
+/// passed to [new StreamZip].
+///
+/// Any errors from any of the streams are forwarded directly to this stream.
+class StreamZip<T> extends Stream<List<T>> {
+ final Iterable<Stream<T>> _streams;
+
+ StreamZip(Iterable<Stream<T>> streams) : _streams = streams;
- StreamSubscription<List> listen(void onData(List data), {
+ StreamSubscription<List<T>> listen(void onData(List data), {
Function onError,
void onDone(),
bool cancelOnError}) {

Powered by Google App Engine
This is Rietveld 408576698