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

Side by Side Diff: pkg/observe/lib/src/compound_binding.dart

Issue 19492018: [mdv] Avoid observing placeholder arrays in TemplateIterator (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/mdv/test/template_element_test.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of observe; 5 part of observe;
6 6
7 /** The callback used in the [CompoundBinding.combinator] field. */ 7 /** The callback used in the [CompoundBinding.combinator] field. */
8 typedef Object CompoundBindingCombinator(Map objects); 8 typedef Object CompoundBindingCombinator(Map objects);
9 9
10 /** 10 /**
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 50
51 set combinator(CompoundBindingCombinator combinator) { 51 set combinator(CompoundBindingCombinator combinator) {
52 _combinator = combinator; 52 _combinator = combinator;
53 if (combinator != null) _scheduleResolve(); 53 if (combinator != null) _scheduleResolve();
54 } 54 }
55 55
56 static const _VALUE = const Symbol('value'); 56 static const _VALUE = const Symbol('value');
57 57
58 get value => _value; 58 get value => _value;
59 59
60 int get length => _bindings.length;
61
60 void set value(newValue) { 62 void set value(newValue) {
61 _value = notifyPropertyChange(_VALUE, _value, newValue); 63 _value = notifyPropertyChange(_VALUE, _value, newValue);
62 } 64 }
63 65
64 void bind(name, model, String path) { 66 void bind(name, model, String path) {
65 unbind(name); 67 unbind(name);
66 68
67 // TODO(jmesserly): should we avoid observing until we are observed, 69 // TODO(jmesserly): should we avoid observing until we are observed,
68 // similar to PathObserver? Similar for unobserving? 70 // similar to PathObserver? Similar for unobserving?
69 _bindings[name] = new PathObserver(model, path).bindSync((value) { 71 _bindings[name] = new PathObserver(model, path).bindSync((value) {
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 for (var binding in _bindings.values) { 108 for (var binding in _bindings.values) {
107 binding.cancel(); 109 binding.cancel();
108 } 110 }
109 _bindings.clear(); 111 _bindings.clear();
110 _values.clear(); 112 _values.clear();
111 113
112 _disposed = true; 114 _disposed = true;
113 value = null; 115 value = null;
114 } 116 }
115 } 117 }
OLDNEW
« no previous file with comments | « pkg/mdv/test/template_element_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698