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

Unified Diff: sky/examples/fn/lib/event.dart

Issue 975863003: Don't hardcode the list of events types in fn (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: More careful event syncing Created 5 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
« no previous file with comments | « sky/examples/fn/lib/component.dart ('k') | sky/examples/fn/lib/fn.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/examples/fn/lib/event.dart
diff --git a/sky/examples/fn/lib/event.dart b/sky/examples/fn/lib/event.dart
new file mode 100644
index 0000000000000000000000000000000000000000..5b96d739d458207a586f7fe694d672e6d066c673
--- /dev/null
+++ b/sky/examples/fn/lib/event.dart
@@ -0,0 +1,25 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+part of fn;
+
+class EventHandler {
+ final String type;
+ final sky.EventListener listener;
+
+ EventHandler(this.type, this.listener);
+}
+
+class EventMap {
+ final List<EventHandler> _handlers = new List<EventHandler>();
+
+ void listen(String type, sky.EventListener listener) {
+ assert(listener != null);
+ _handlers.add(new EventHandler(type, listener));
+ }
+
+ void addAll(EventMap events) {
+ _handlers.addAll(events._handlers);
+ }
+}
« no previous file with comments | « sky/examples/fn/lib/component.dart ('k') | sky/examples/fn/lib/fn.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698