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

Unified Diff: samples/third_party/todomvc/test/utils.dart

Issue 60353013: Update TodoMVC based on https://github.com/polymer/todomvc (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merged Created 7 years, 1 month 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
« no previous file with comments | « samples/third_party/todomvc/test/markdone_test.html ('k') | samples/third_party/todomvc/web/app.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samples/third_party/todomvc/test/utils.dart
diff --git a/samples/third_party/todomvc/test/utils.dart b/samples/third_party/todomvc/test/utils.dart
new file mode 100644
index 0000000000000000000000000000000000000000..196ca1eac35b46e4956127b35222322f1c0ba099
--- /dev/null
+++ b/samples/third_party/todomvc/test/utils.dart
@@ -0,0 +1,23 @@
+// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library todomvc.test.utils;
+
+import 'dart:async';
+import 'package:observe/observe.dart';
+
+Future onPropertyInit(Observable obj, String path) {
+ final obs = new PathObserver(obj, path);
+ if (obs.value != null) return new Future.value(obs.value);
+
+ final c = new Completer();
+ StreamSubscription sub;
+ sub = obs.changes.listen((_) {
+ if (obs.value != null) {
+ sub.cancel();
+ c.complete(obs.value);
+ }
+ });
+ return c.future;
+}
« no previous file with comments | « samples/third_party/todomvc/test/markdone_test.html ('k') | samples/third_party/todomvc/web/app.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698