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

Unified Diff: src/site/articles/using-future-based-apis/code/example3.dart

Issue 99503002: appropriating Shailen's excellent Futures intro into tutorial (Closed) Base URL: https://github.com/dart-lang/dartlang.org.git@master
Patch Set: Created 7 years 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
Index: src/site/articles/using-future-based-apis/code/example3.dart
diff --git a/src/site/articles/using-future-based-apis/code/example3.dart b/src/site/articles/using-future-based-apis/code/example3.dart
deleted file mode 100644
index 584db087c5f157197f676b6f2a395b750304f7da..0000000000000000000000000000000000000000
--- a/src/site/articles/using-future-based-apis/code/example3.dart
+++ /dev/null
@@ -1,36 +0,0 @@
-import 'dart:io';
-import 'dart:async';
-
-void printDailyNewsDigest() {
- File file = new File("dailyNewsDigest.txt");
- Future future = file.readAsString();
- future.then((content) => doSomethingWith(content))
- .catchError((e) => handleError(e));
-}
-
-void main() {
- printDailyNewsDigest();
- printWinningLotteryNumbers();
- printWeatherForecast();
- printBaseballScore();
-}
-
-doSomethingWith(content) {
- print('do something with content');
-}
-
-handleError(e) {
- print('handleError');
-}
-
-printWinningLotteryNumbers() {
- print('Winning lotto numbers: [23, 63, 87, 26, 2]');
-}
-
-printWeatherForecast() {
- print('Tomorrow\'s forecast: 70F, sunny.');
-}
-
-printBaseballScore() {
- print('Baseball score: Red Sox 10, Yankees 0');
-}

Powered by Google App Engine
This is Rietveld 408576698