| 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 part of observe; | 5 library observe.src.bind_property; |
| 6 |
| 7 import 'dart:async'; |
| 8 import 'package:observe/observe.dart'; |
| 6 | 9 |
| 7 /** | 10 /** |
| 8 * Forwards an observable property from one object to another. For example: | 11 * Forwards an observable property from one object to another. For example: |
| 9 * | 12 * |
| 10 * class MyModel extends Observable { | 13 * class MyModel extends Observable { |
| 11 * StreamSubscription _sub; | 14 * StreamSubscription _sub; |
| 12 * MyOtherModel _otherModel; | 15 * MyOtherModel _otherModel; |
| 13 * | 16 * |
| 14 * MyModel() { | 17 * MyModel() { |
| 15 * ... | 18 * ... |
| (...skipping 13 matching lines...) Expand all Loading... |
| 29 return source.changes.listen((records) { | 32 return source.changes.listen((records) { |
| 30 for (var record in records) { | 33 for (var record in records) { |
| 31 if (record is PropertyChangeRecord && | 34 if (record is PropertyChangeRecord && |
| 32 (record as PropertyChangeRecord).name == sourceName) { | 35 (record as PropertyChangeRecord).name == sourceName) { |
| 33 callback(); | 36 callback(); |
| 34 break; | 37 break; |
| 35 } | 38 } |
| 36 } | 39 } |
| 37 }); | 40 }); |
| 38 } | 41 } |
| OLD | NEW |