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

Side by Side Diff: lib/src/stream_sink_transformer/typed.dart

Issue 1947923003: Add APIs for asserting the types of transformers. (Closed) Base URL: git@github.com:dart-lang/async.git@master
Patch Set: Created 4 years, 7 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4
5 import 'dart:async';
6
7 import '../delegate/stream_sink.dart';
8 import '../stream_sink_transformer.dart';
9
10 /// A wrapper that coerces the type of the sink returned by an inner
11 /// transformer.
Lasse Reichstein Nielsen 2016/05/09 19:20:12 "coerces" isn't specific enough. At least say what
nweiz 2016/05/09 19:31:51 Done.
12 class TypeSafeStreamSinkTransformer<S, T>
13 implements StreamSinkTransformer<S, T> {
14 final StreamSinkTransformer _inner;
15
16 TypeSafeStreamSinkTransformer(this._inner);
17
18 StreamSink<S> bind(StreamSink<T> sink) =>
19 DelegatingStreamSink.typed(_inner.bind(sink));
20 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698