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

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

Issue 83663005: added front page samples to testing, plus a couple of tweaks to front page and code lab (Closed) Base URL: https://github.com/dart-lang/dartlang.org.git@master
Patch Set: changed width of iframe for pirate badge app 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
« no previous file with comments | « src/site/index.html ('k') | src/tests/site/code/collections.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 import 'dart:async';
2 import 'dart:html';
3
4 void main() {
5 // Get a stream of key-press events from an element:
6 querySelector('textarea').onKeyPress
7
8 // Filter the stream, getting a stream of events only for certain key codes:
9 .where((e) => e.keyCode >= 32 && e.keyCode <= 122)
10
11 // Convert those key codes, getting a stream of corresponding characters:
12 .map((e) => new String.fromCharCode(e.charCode))
13
14 // Ask for the first character, getting a Future.
15 .first
16
17 // When the Future completes, print the first character to the console.
18 .then((char) => print('First char=$char'));
19 }
OLDNEW
« no previous file with comments | « src/site/index.html ('k') | src/tests/site/code/collections.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698