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

Side by Side Diff: src/tests/site/code/futures.dart

Issue 22528003: update examples on homepage (Closed) Base URL: https://github.com/dart-lang/dartlang.org.git@master
Patch Set: Created 7 years, 4 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 import 'dart:io';
2 import 'dart:async';
3
4 void printDailyNewsDigest() {
5 File file = new File("dailyNewsDigest.txt");
6 Future future = file.readAsString(); // readAsString() returns a Future.
7 future.then((content) {
8 print(content); // Executes when the future's work is done.
9 });
sethladd 2013/08/08 05:06:29 how about a catchError. I think that's a cool feat
Kathy Walrath 2013/08/08 17:09:38 Done.
10 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698