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

Unified Diff: lib/src/delegating_stream_channel.dart

Issue 1617483003: Add a DelegatingStreamChannel class. (Closed) Base URL: git@github.com:dart-lang/stream_channel.git@master
Patch Set: Created 4 years, 11 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
« no previous file with comments | « no previous file | lib/stream_channel.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/delegating_stream_channel.dart
diff --git a/lib/src/delegating_stream_channel.dart b/lib/src/delegating_stream_channel.dart
new file mode 100644
index 0000000000000000000000000000000000000000..9d6ad90fdca3d113c9317dd93dbfb757763a810e
--- /dev/null
+++ b/lib/src/delegating_stream_channel.dart
@@ -0,0 +1,17 @@
+// 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.
+
+/// A simple delegating wrapper around [StreamChannel].
+///
+/// Subclasses can override individual methods, or use this to expose only
+/// [StreamChannel] methods.
+class StreamChannelView<T> extends StreamChannelMixin<T> {
+ /// The inner channel to which methods are forwarded.
+ final StreamChannel<T> _inner;
+
+ Stream<T> get stream => _inner.stream;
+ StreamSink<T> get sink => _inner.sink;
+
+ StreamChannelView(this._inner);
+}
« no previous file with comments | « no previous file | lib/stream_channel.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698