| OLD | NEW |
| 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 /** | 5 /** |
| 6 * *Warning*: this library is experimental, and APIs are subject to change. | 6 * *Warning*: this library is experimental, and APIs are subject to change. |
| 7 * | 7 * |
| 8 * This library is used to observe changes to [Observable] types. It also | 8 * This library is used to observe changes to [Observable] types. It also |
| 9 * has helpers to make implementing and using [Observable] objects easy. | 9 * has helpers to make implementing and using [Observable] objects easy. |
| 10 * | 10 * |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 * var obj = new Monster(); | 58 * var obj = new Monster(); |
| 59 * obj.changes.listen((records) { | 59 * obj.changes.listen((records) { |
| 60 * print('Changes to $obj were: $records'); | 60 * print('Changes to $obj were: $records'); |
| 61 * }); | 61 * }); |
| 62 * // Schedules asynchronous delivery of these changes | 62 * // Schedules asynchronous delivery of these changes |
| 63 * obj.damage(10); | 63 * obj.damage(10); |
| 64 * obj.damage(20); | 64 * obj.damage(20); |
| 65 * print('done!'); | 65 * print('done!'); |
| 66 * } | 66 * } |
| 67 * | 67 * |
| 68 * [Tools](https://github.com/dart-lang/web-ui) exist to convert the first form | 68 * [Tools](https://www.dartlang.org/polymer-dart/) exist to convert the first |
| 69 * into the second form automatically, to get the best of both worlds. | 69 * form into the second form automatically, to get the best of both worlds. |
| 70 */ | 70 */ |
| 71 library observe; | 71 library observe; |
| 72 | 72 |
| 73 import 'dart:async'; | 73 import 'dart:async'; |
| 74 import 'dart:collection'; | 74 import 'dart:collection'; |
| 75 import 'dart:mirrors'; | 75 import 'dart:mirrors'; |
| 76 | 76 |
| 77 // Note: this is an internal library so we can import it from tests. | 77 // Note: this is an internal library so we can import it from tests. |
| 78 // TODO(jmesserly): ideally we could import this with a prefix, but it caused | 78 // TODO(jmesserly): ideally we could import this with a prefix, but it caused |
| 79 // strange problems on the VM when I tested out the dirty-checking example | 79 // strange problems on the VM when I tested out the dirty-checking example |
| 80 // above. | 80 // above. |
| 81 import 'src/dirty_check.dart'; | 81 import 'src/dirty_check.dart'; |
| 82 | 82 |
| 83 part 'src/bind_property.dart'; | 83 part 'src/bind_property.dart'; |
| 84 part 'src/change_notifier.dart'; | 84 part 'src/change_notifier.dart'; |
| 85 part 'src/change_record.dart'; | 85 part 'src/change_record.dart'; |
| 86 part 'src/compound_binding.dart'; | 86 part 'src/compound_binding.dart'; |
| 87 part 'src/list_path_observer.dart'; | 87 part 'src/list_path_observer.dart'; |
| 88 part 'src/observable.dart'; | 88 part 'src/observable.dart'; |
| 89 part 'src/observable_box.dart'; | 89 part 'src/observable_box.dart'; |
| 90 part 'src/observable_list.dart'; | 90 part 'src/observable_list.dart'; |
| 91 part 'src/observable_map.dart'; | 91 part 'src/observable_map.dart'; |
| 92 part 'src/path_observer.dart'; | 92 part 'src/path_observer.dart'; |
| 93 part 'src/to_observable.dart'; | 93 part 'src/to_observable.dart'; |
| OLD | NEW |