| 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.compound_binding; |
| 6 |
| 7 import 'dart:async'; |
| 8 import 'package:observe/observe.dart'; |
| 6 | 9 |
| 7 /** The callback used in the [CompoundBinding.combinator] field. */ | 10 /** The callback used in the [CompoundBinding.combinator] field. */ |
| 8 typedef Object CompoundBindingCombinator(Map objects); | 11 typedef Object CompoundBindingCombinator(Map objects); |
| 9 | 12 |
| 10 /** | 13 /** |
| 11 * CompoundBinding is an object which knows how to listen to multiple path | 14 * CompoundBinding is an object which knows how to listen to multiple path |
| 12 * values (registered via [bind]) and invoke its [combinator] when one or more | 15 * values (registered via [bind]) and invoke its [combinator] when one or more |
| 13 * of the values have changed and set its [value] property to the return value | 16 * of the values have changed and set its [value] property to the return value |
| 14 * of the function. When any value has changed, all current values are provided | 17 * of the function. When any value has changed, all current values are provided |
| 15 * to the [combinator] in the single `values` argument. | 18 * to the [combinator] in the single `values` argument. |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 */ | 125 */ |
| 123 void close() { | 126 void close() { |
| 124 for (var binding in _observers.values) { | 127 for (var binding in _observers.values) { |
| 125 binding.cancel(); | 128 binding.cancel(); |
| 126 } | 129 } |
| 127 _observers.clear(); | 130 _observers.clear(); |
| 128 _values.clear(); | 131 _values.clear(); |
| 129 value = null; | 132 value = null; |
| 130 } | 133 } |
| 131 | 134 |
| 132 _unobserved() => close(); | 135 unobserved() => close(); |
| 133 } | 136 } |
| OLD | NEW |