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

Side by Side Diff: src/site/articles/using-future-based-apis/code/example4.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: another pesky file 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 unified diff | Download patch
OLDNEW
(Empty)
1 import 'dart:io';
2 import 'dart:async';
3
4 void main() {
5 expensiveA().then((aValue) => expensiveB())
6 .then((bValue) => expensiveC())
7 .then((cValue) => doSomethingWith(cValue));
8 }
9
10 Future expensiveA() => new Future.value('from expensiveA');
11 Future expensiveB() => new Future.value('from expensiveB');
12 Future expensiveC() => new Future.value('from expensiveC');
13
14 doSomethingWith(value) {
15 print(value);
16 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698