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

Unified Diff: sdk/lib/async/stream_transformers.dart

Issue 2864863002: Update StreamTransformer documentation. (Closed)
Patch Set: Address comments. Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sdk/lib/async/stream.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/async/stream_transformers.dart
diff --git a/sdk/lib/async/stream_transformers.dart b/sdk/lib/async/stream_transformers.dart
index bfc83d6b58b4befbe215bd641956492567b85380..3f4857707ee4786f55a7fda679ab4f71696fe36e 100644
--- a/sdk/lib/async/stream_transformers.dart
+++ b/sdk/lib/async/stream_transformers.dart
@@ -276,31 +276,31 @@ typedef StreamSubscription<T> _SubscriptionTransformer<S, T>(
* fully general.
*/
class _StreamSubscriptionTransformer<S, T> implements StreamTransformer<S, T> {
- final _SubscriptionTransformer<S, T> _transformer;
+ final _SubscriptionTransformer<S, T> _onListen;
- const _StreamSubscriptionTransformer(this._transformer);
+ const _StreamSubscriptionTransformer(this._onListen);
Stream<T> bind(Stream<S> stream) =>
- new _BoundSubscriptionStream<S, T>(stream, _transformer);
+ new _BoundSubscriptionStream<S, T>(stream, _onListen);
}
/**
* A stream transformed by a [_StreamSubscriptionTransformer].
*
- * When this stream is listened to it invokes the [_transformer] function with
+ * When this stream is listened to it invokes the [_onListen] function with
* the stored [_stream]. Usually the transformer starts listening at this
* moment.
*/
class _BoundSubscriptionStream<S, T> extends Stream<T> {
- final _SubscriptionTransformer<S, T> _transformer;
+ final _SubscriptionTransformer<S, T> _onListen;
final Stream<S> _stream;
- _BoundSubscriptionStream(this._stream, this._transformer);
+ _BoundSubscriptionStream(this._stream, this._onListen);
StreamSubscription<T> listen(void onData(T event),
{Function onError, void onDone(), bool cancelOnError}) {
cancelOnError = identical(true, cancelOnError);
- StreamSubscription<T> result = _transformer(_stream, cancelOnError);
+ StreamSubscription<T> result = _onListen(_stream, cancelOnError);
result.onData(onData);
result.onError(onError);
result.onDone(onDone);
« no previous file with comments | « sdk/lib/async/stream.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698