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

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

Issue 26734004: use symbol literals instead of const ctor in packages (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 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/observe/lib/src/bind_property.dart ('k') | pkg/observe/lib/src/compound_binding.dart » ('j') | 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 /** 7 /**
8 * Base class implementing [Observable] object that performs its own change 8 * Base class implementing [Observable] object that performs its own change
9 * notifications, and does not need to be considered by [Observable.dirtyCheck]. 9 * notifications, and does not need to be considered by [Observable.dirtyCheck].
10 * 10 *
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 * 66 *
67 * The [oldValue] and [newValue] are also recorded. If the two values are 67 * The [oldValue] and [newValue] are also recorded. If the two values are
68 * identical, no change will be recorded. 68 * identical, no change will be recorded.
69 * 69 *
70 * For convenience this returns [newValue]. This makes it easy to use in a 70 * For convenience this returns [newValue]. This makes it easy to use in a
71 * setter: 71 * setter:
72 * 72 *
73 * var _myField; 73 * var _myField;
74 * get myField => _myField; 74 * get myField => _myField;
75 * set myField(value) { 75 * set myField(value) {
76 * _myField = notifyPropertyChange( 76 * _myField = notifyPropertyChange(#myField, _myField, value);
77 * const Symbol('myField'), _myField, value);
78 * } 77 * }
79 */ 78 */
80 notifyPropertyChange(Symbol field, Object oldValue, Object newValue) 79 notifyPropertyChange(Symbol field, Object oldValue, Object newValue)
81 => _notifyPropertyChange(this, field, oldValue, newValue); 80 => _notifyPropertyChange(this, field, oldValue, newValue);
82 81
83 void notifyChange(ChangeRecord record) { 82 void notifyChange(ChangeRecord record) {
84 if (!hasObservers) return; 83 if (!hasObservers) return;
85 84
86 if (_records == null) { 85 if (_records == null) {
87 _records = []; 86 _records = [];
88 runAsync(deliverChanges); 87 runAsync(deliverChanges);
89 } 88 }
90 _records.add(record); 89 _records.add(record);
91 } 90 }
92 } 91 }
OLDNEW
« no previous file with comments | « pkg/observe/lib/src/bind_property.dart ('k') | pkg/observe/lib/src/compound_binding.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698