| 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:collection'; | 7 import 'dart:collection'; |
| 8 import 'dart:collection-dev'; | |
| 9 | 8 |
| 10 part 'ChangeEvent.dart'; | 9 part 'ChangeEvent.dart'; |
| 11 part 'EventBatch.dart'; | 10 part 'EventBatch.dart'; |
| 12 | 11 |
| 13 /** | 12 /** |
| 14 * An object whose changes are tracked and who can issue events notifying how it | 13 * An object whose changes are tracked and who can issue events notifying how it |
| 15 * has been changed. | 14 * has been changed. |
| 16 */ | 15 */ |
| 17 abstract class Observable { | 16 abstract class Observable { |
| 18 /** Returns a globally unique identifier for the object. */ | 17 /** Returns a globally unique identifier for the object. */ |
| (...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 324 // Only fire on an actual change. | 323 // Only fire on an actual change. |
| 325 if (!identical(newValue, _value)) { | 324 if (!identical(newValue, _value)) { |
| 326 final oldValue = _value; | 325 final oldValue = _value; |
| 327 _value = newValue; | 326 _value = newValue; |
| 328 recordPropertyUpdate("value", newValue, oldValue); | 327 recordPropertyUpdate("value", newValue, oldValue); |
| 329 } | 328 } |
| 330 } | 329 } |
| 331 | 330 |
| 332 T _value; | 331 T _value; |
| 333 } | 332 } |
| OLD | NEW |