Chromium Code Reviews| Index: pkg/observe/lib/src/bindable.dart |
| diff --git a/pkg/observe/lib/src/bindable.dart b/pkg/observe/lib/src/bindable.dart |
| index 4b628a60b82e3931ec67ecba50986bc090ac5e55..4303768a3e107b346dd4ab1a13bbaefee2ded01e 100644 |
| --- a/pkg/observe/lib/src/bindable.dart |
| +++ b/pkg/observe/lib/src/bindable.dart |
| @@ -8,10 +8,9 @@ library observe.src.bindable; |
| // Normally this is used with 'package:template_binding'. |
| // TODO(jmesserly): Node.bind polyfill calls this "observable" |
| abstract class Bindable { |
| - // TODO(jmesserly): since we have "value", should open be a void method? |
| // Dart note: changed setValue to be "set value" and discardChanges() to |
| // be "get value". Also "set value" implies discard changes. |
|
Siggi Cherem (dart-lang)
2014/07/07 19:41:14
I guess we can now remove the "Also ..."
|
| - // TOOD(jmesserly): is this change too subtle? Is there any other way to |
| + // TODO(jmesserly): is this change too subtle? Is there any other way to |
| // make Bindable friendly in a world with getters/setters? |
| /// Initiates observation and returns the initial value. |
| @@ -28,10 +27,18 @@ abstract class Bindable { |
| void close(); |
| /// Gets the current value of the bindings. |
| + /// Note: once the value of a [Bindable] is fetched, the callback passed to |
| + /// [open] should not be called again with this new value. |
| + /// In other words, any pending change notifications must be discarded. |
| + // TODO(jmesserly): I don't like a getter with side effects. Should we just |
| + // rename the getter/setter pair to discardChanges/setValue like they are in |
| + // JavaScript? |
| get value; |
| /// This can be implemented for two-way bindings. By default does nothing. |
| - /// Note: setting the value of a [Bindable] must not call the [callback] with |
| - /// the new value. Any pending change notifications must be discarded. |
| set value(newValue) {} |
| + |
| + /// Deliver changes. Typically this will perform dirty-checking, if any is |
| + /// needed. |
| + void deliver() {} |
| } |