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

Side by Side Diff: src/site/docs/tutorials/streams/index.markdown

Issue 246783005: fixing bug 18336, skipWhile comment was wrong (Closed) Base URL: https://github.com/dart-lang/dartlang.org.git@master
Patch Set: merge master Created 6 years, 8 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 --- 1 ---
2 layout: tutorial 2 layout: tutorial
3 title: "Use Streams for Data" 3 title: "Use Streams for Data"
4 description: 4 description:
5 Learn how to consume single-subscriber and broadcast streams, 5 Learn how to consume single-subscriber and broadcast streams,
6 with real-world uses. 6 with real-world uses.
7 tutorial: 7 tutorial:
8 id: streams 8 id: streams
9 next: fetchdata/ 9 next: fetchdata/
10 next-title: "Fetch Data Dynamically" 10 next-title: "Fetch Data Dynamically"
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 .listen((value) => print("skip: $value")); // skip: 4 218 .listen((value) => print("skip: $value")); // skip: 4
219 // skip: 5 219 // skip: 5
220 220
221 broadcastStream 221 broadcastStream
222 .takeWhile((value) => value < 3) // take while true 222 .takeWhile((value) => value < 3) // take while true
223 .listen((value) => print("takeWhile: $value")); // takeWhile: 1 223 .listen((value) => print("takeWhile: $value")); // takeWhile: 1
224 // takeWhile: 2 224 // takeWhile: 2
225 225
226 broadcastStream 226 broadcastStream
227 .skipWhile((value) => value < 3) // skip while true 227 .skipWhile((value) => value < 3) // skip while true
228 .listen((value) => print("skipWhile: $value")); // skipWhile: 4 228 .listen((value) => print("skipWhile: $value")); // skipWhile: 3
229 // skipWhile: 4
229 // skipWhile: 5 230 // skipWhile: 5
230 {% endprettify %}<!--- END(stream_subsets) --> 231 {% endprettify %}<!--- END(stream_subsets) -->
231 232
232 ### Transforming stream data 233 ### Transforming stream data
233 234
234 Another useful method is the `transform()` method, which takes a 235 Another useful method is the `transform()` method, which takes a
235 `StreamTransformer` instance. This allows you to modify the contents of the 236 `StreamTransformer` instance. This allows you to modify the contents of the
236 stream. The `StreamTransformer.fromHandlers` constructor takes a `handleData` f unction, 237 stream. The `StreamTransformer.fromHandlers` constructor takes a `handleData` f unction,
237 which is called for each value passed from the stream. You can modify the value 238 which is called for each value passed from the stream. You can modify the value
238 as you wish, and add it back to the `StreamSink`, which results in the modified 239 as you wish, and add it back to the `StreamSink`, which results in the modified
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
501 Chris Buckett is a Technical Manager for 502 Chris Buckett is a Technical Manager for
502 [Entity Group Ltd](http://www.entity.co.uk/), responsible for building and 503 [Entity Group Ltd](http://www.entity.co.uk/), responsible for building and
503 delivering enterprise client-server webapps, mostly with GWT, Java and .Net. 504 delivering enterprise client-server webapps, mostly with GWT, Java and .Net.
504 He runs the [dartwatch.com blog](http://blog.dartwatch.com/), and has written 505 He runs the [dartwatch.com blog](http://blog.dartwatch.com/), and has written
505 the book _Dart in Action_, which is available 506 the book _Dart in Action_, which is available
506 at [manning.com](http://www.manning.com/buckett). 507 at [manning.com](http://www.manning.com/buckett).
507 508
508 {% endcapture %} 509 {% endcapture %}
509 510
510 {% include tutorial.html %} 511 {% include tutorial.html %}
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698