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

Side by Side Diff: pkg/mdv/lib/src/bindings.dart

Issue 19771010: implement dirty checking for @observable objects (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 | « no previous file | pkg/mdv/lib/src/element.dart » ('j') | pkg/mdv/test/mdv_test_utils.dart » ('J')
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 mdv; 5 part of mdv;
6 6
7 // This code is a port of Model-Driven-Views: 7 // This code is a port of Model-Driven-Views:
8 // https://github.com/polymer-project/mdv 8 // https://github.com/polymer-project/mdv
9 // The code mostly comes from src/template_element.js 9 // The code mostly comes from src/template_element.js
10 10
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 final Element _templateElement; 239 final Element _templateElement;
240 final List<Node> terminators = []; 240 final List<Node> terminators = [];
241 final CompoundBinding inputs; 241 final CompoundBinding inputs;
242 List iteratedValue; 242 List iteratedValue;
243 Object _lastValue; 243 Object _lastValue;
244 244
245 StreamSubscription _sub; 245 StreamSubscription _sub;
246 StreamSubscription _valueBinding; 246 StreamSubscription _valueBinding;
247 247
248 _TemplateIterator(this._templateElement) 248 _TemplateIterator(this._templateElement)
249 : inputs = new CompoundBinding(resolveInputs) { 249 : inputs = new CompoundBinding(resolveInputs) {
250 250
251 _valueBinding = new PathObserver(inputs, 'value').bindSync(valueChanged); 251 _valueBinding = new PathObserver(inputs, 'value').bindSync(valueChanged);
252 } 252 }
253 253
254 static Object resolveInputs(Map values) { 254 static Object resolveInputs(Map values) {
255 if (values.containsKey('if') && !_toBoolean(values['if'])) { 255 if (values.containsKey('if') && !_toBoolean(values['if'])) {
256 return null; 256 return null;
257 } 257 }
258 258
259 if (values.containsKey('repeat')) { 259 if (values.containsKey('repeat')) {
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 nodeExt._templateIterator = null; 421 nodeExt._templateIterator = null;
422 } 422 }
423 } 423 }
424 424
425 _nodeOrCustom(node).unbindAll(); 425 _nodeOrCustom(node).unbindAll();
426 for (var c = node.firstChild; c != null; c = c.nextNode) { 426 for (var c = node.firstChild; c != null; c = c.nextNode) {
427 _unbindAllRecursively(c); 427 _unbindAllRecursively(c);
428 } 428 }
429 } 429 }
430 } 430 }
OLDNEW
« no previous file with comments | « no previous file | pkg/mdv/lib/src/element.dart » ('j') | pkg/mdv/test/mdv_test_utils.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698