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'; | 7 #import('dart:coreimpl'); |
8 | 8 |
9 part 'ChangeEvent.dart'; | 9 #source('ChangeEvent.dart'); |
10 part 'EventBatch.dart'; | 10 #source('EventBatch.dart'); |
11 | 11 |
12 /** | 12 /** |
13 * 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 |
14 * has been changed. | 14 * has been changed. |
15 */ | 15 */ |
16 abstract class Observable { | 16 abstract class Observable { |
17 /** Returns a globally unique identifier for the object. */ | 17 /** Returns a globally unique identifier for the object. */ |
18 // TODO(sigmund): remove once dart supports maps with arbitrary keys. | 18 // TODO(sigmund): remove once dart supports maps with arbitrary keys. |
19 int get uid; | 19 int get uid; |
20 | 20 |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 // equality check should be done? | 290 // equality check should be done? |
291 if (newValue !== _value) { | 291 if (newValue !== _value) { |
292 final oldValue = _value; | 292 final oldValue = _value; |
293 _value = newValue; | 293 _value = newValue; |
294 recordPropertyUpdate("value", newValue, oldValue); | 294 recordPropertyUpdate("value", newValue, oldValue); |
295 } | 295 } |
296 } | 296 } |
297 | 297 |
298 T _value; | 298 T _value; |
299 } | 299 } |
OLD | NEW |