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

Unified Diff: packages/async/lib/src/stream_sink_transformer/typed.dart

Issue 2989763002: Update charted to 0.4.8 and roll (Closed)
Patch Set: Removed Cutch from list of reviewers Created 3 years, 5 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: packages/async/lib/src/stream_sink_transformer/typed.dart
diff --git a/packages/async/lib/src/stream_sink_transformer/typed.dart b/packages/async/lib/src/stream_sink_transformer/typed.dart
new file mode 100644
index 0000000000000000000000000000000000000000..303bc08d76101d34679e1ada89945ab76d43fb7e
--- /dev/null
+++ b/packages/async/lib/src/stream_sink_transformer/typed.dart
@@ -0,0 +1,20 @@
+// 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.
+
+import 'dart:async';
+
+import '../delegate/stream_sink.dart';
+import '../stream_sink_transformer.dart';
+
+/// A wrapper that coerces the generic type of the sink returned by an inner
+/// transformer to `S`.
+class TypeSafeStreamSinkTransformer<S, T>
+ implements StreamSinkTransformer<S, T> {
+ final StreamSinkTransformer _inner;
+
+ TypeSafeStreamSinkTransformer(this._inner);
+
+ StreamSink<S> bind(StreamSink<T> sink) =>
+ DelegatingStreamSink.typed(_inner.bind(sink));
+}

Powered by Google App Engine
This is Rietveld 408576698