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

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

Issue 50313004: Revert "Remove @deprecated features." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/observe/lib/src/change_record.dart ('k') | pkg/observe/lib/src/observable_map.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 * Represents an object with observable properties. This is used by data in 8 * Represents an object with observable properties. This is used by data in
9 * model-view architectures to notify interested parties of [changes] to the 9 * model-view architectures to notify interested parties of [changes] to the
10 * object's properties (fields or getter/setter pairs). 10 * object's properties (fields or getter/setter pairs).
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 * [Observable.dirtyCheck] instead. 164 * [Observable.dirtyCheck] instead.
165 */ 165 */
166 void notifyChange(ChangeRecord record) { 166 void notifyChange(ChangeRecord record) {
167 if (!hasObservers) return; 167 if (!hasObservers) return;
168 168
169 if (_records == null) _records = []; 169 if (_records == null) _records = [];
170 _records.add(record); 170 _records.add(record);
171 } 171 }
172 } 172 }
173 173
174 /**
175 * *Deprecated* use [Observable.notifyPropertyChange] instead.
176 *
177 * This API should not be used as it creates a
178 * [PropertyChangeRecord] without oldValue and newValue.
179 *
180 * Notify the property change. Shorthand for:
181 *
182 * target.notifyChange(new PropertyChangeRecord(target, name, null, null));
183 */
184 @deprecated
185 void notifyProperty(Observable target, Symbol name) {
186 target.notifyChange(new PropertyChangeRecord(target, name, null, null));
187 }
188
174 // TODO(jmesserly): remove the instance method and make this top-level method 189 // TODO(jmesserly): remove the instance method and make this top-level method
175 // public instead? 190 // public instead?
176 _notifyPropertyChange(Observable obj, Symbol field, Object oldValue, 191 _notifyPropertyChange(Observable obj, Symbol field, Object oldValue,
177 Object newValue) { 192 Object newValue) {
178 193
179 if (obj.hasObservers && oldValue != newValue) { 194 if (obj.hasObservers && oldValue != newValue) {
180 obj.notifyChange(new PropertyChangeRecord(obj, field, oldValue, newValue)); 195 obj.notifyChange(new PropertyChangeRecord(obj, field, oldValue, newValue));
181 } 196 }
182 return newValue; 197 return newValue;
183 } 198 }
OLDNEW
« no previous file with comments | « pkg/observe/lib/src/change_record.dart ('k') | pkg/observe/lib/src/observable_map.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698