| Index: pkg/barback/lib/src/utils.dart
|
| diff --git a/pkg/barback/lib/src/utils.dart b/pkg/barback/lib/src/utils.dart
|
| index 71576ff32c8abf5586ef3ca53a5e7c7e6f52a2c8..a4a59507a00b2a5215218b6a661bda9cc5580d80 100644
|
| --- a/pkg/barback/lib/src/utils.dart
|
| +++ b/pkg/barback/lib/src/utils.dart
|
| @@ -7,6 +7,8 @@ library barback.utils;
|
| import 'dart:async';
|
| import 'dart:typed_data';
|
|
|
| +import 'package:stack_trace/stack_trace.dart';
|
| +
|
| /// A pair of values.
|
| class Pair<E, F> {
|
| E first;
|
| @@ -151,12 +153,12 @@ Stream mergeStreams(Iterable<Stream> streams, {bool broadcast: false}) {
|
|
|
| for (var stream in streams) {
|
| stream.listen(
|
| - controller.add,
|
| - onError: controller.addError,
|
| - onDone: () {
|
| - doneCount++;
|
| - if (doneCount == streams.length) controller.close();
|
| - });
|
| + controller.add,
|
| + onError: controller.addError,
|
| + onDone: () {
|
| + doneCount++;
|
| + if (doneCount == streams.length) controller.close();
|
| + });
|
| }
|
|
|
| return controller.stream;
|
| @@ -193,6 +195,9 @@ Future pumpEventQueue([int times=20]) {
|
| // TODO(jmesserly): doc comment changed to due 14601.
|
| Future newFuture(callback()) => new Future.value().then((_) => callback());
|
|
|
| +/// Like [Future.sync], but wraps the Future in [Chain.track] as well.
|
| +Future syncFuture(callback()) => Chain.track(new Future.sync(callback));
|
| +
|
| /// Returns a buffered stream that will emit the same values as the stream
|
| /// returned by [future] once [future] completes.
|
| ///
|
|
|