| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 library observable; | 5 library observable; |
| 6 | 6 |
| 7 import 'dart:coreimpl'; | |
| 8 | |
| 9 part 'ChangeEvent.dart'; | 7 part 'ChangeEvent.dart'; |
| 10 part 'EventBatch.dart'; | 8 part 'EventBatch.dart'; |
| 11 | 9 |
| 12 /** | 10 /** |
| 13 * An object whose changes are tracked and who can issue events notifying how it | 11 * An object whose changes are tracked and who can issue events notifying how it |
| 14 * has been changed. | 12 * has been changed. |
| 15 */ | 13 */ |
| 16 abstract class Observable { | 14 abstract class Observable { |
| 17 /** Returns a globally unique identifier for the object. */ | 15 /** Returns a globally unique identifier for the object. */ |
| 18 // TODO(sigmund): remove once dart supports maps with arbitrary keys. | 16 // TODO(sigmund): remove once dart supports maps with arbitrary keys. |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 // Only fire on an actual change. | 285 // Only fire on an actual change. |
| 288 if (!identical(newValue, _value)) { | 286 if (!identical(newValue, _value)) { |
| 289 final oldValue = _value; | 287 final oldValue = _value; |
| 290 _value = newValue; | 288 _value = newValue; |
| 291 recordPropertyUpdate("value", newValue, oldValue); | 289 recordPropertyUpdate("value", newValue, oldValue); |
| 292 } | 290 } |
| 293 } | 291 } |
| 294 | 292 |
| 295 T _value; | 293 T _value; |
| 296 } | 294 } |
| OLD | NEW |