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

Unified Diff: samples/swarm/App.dart

Issue 12218131: Combine window.setTimeout/setInterval with Timer and Timer.repeating. Also (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: samples/swarm/App.dart
diff --git a/samples/swarm/App.dart b/samples/swarm/App.dart
index 2837320a1de5c78028cf056780a3800701ee550e..e27b445f5f5221378aca18e8bad289e0ba629b8a 100644
--- a/samples/swarm/App.dart
+++ b/samples/swarm/App.dart
@@ -27,9 +27,9 @@ class App {
if (document.readyState == "interactive" ||
document.readyState == "complete" ||
document.readyState == "loaded") {
- // We use setTimeout to insure that onLoad is always called in an async
+ // We use a timer to insure that onLoad is always called in an async
// manner even if the document is already loaded.
- window.setTimeout(() => onLoad(), 0);
+ new Timer(const Duration(milliseconds:0), () => onLoad());
blois 2013/02/13 03:09:24 I believe this is equivalent to Timer.run, if so,
floitsch 2013/02/13 10:03:07 Yes. It is. Generally we avoid the empty "const Du
Emily Fortuna 2013/02/13 20:19:44 Done.
} else {
window.onContentLoaded.listen(
// TODO(sigmund): Consider eliminating the call to "wrap", for

Powered by Google App Engine
This is Rietveld 408576698