Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(90)

Side by Side Diff: pkg/observe/lib/src/bindable.dart

Issue 132403010: big update to observe, template_binding, polymer (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4
5 library observe.src.bindable;
6
7 /// An object that can be data bound.
8 // Normally this is used with 'package:template_binding'.
9 // TODO(jmesserly): Node.bind polyfill calls this "observable"
10 abstract class Bindable {
11 // TODO(jmesserly): since we have "value", should open be a void method?
12 // TODO(jmesserly): not sure how I feel about open taking a variable number
13 // of arguments, but it's the easiest way to make CompoundObserver work.
14
15 /// Initiates observation and returns initial value.
Siggi Cherem (dart-lang) 2014/02/03 22:52:48 returns initial => returns the initial
Jennifer Messerly 2014/02/04 00:33:06 Done.
16 /// The callback will be called with updated value. Some subtypes may also
Siggi Cherem (dart-lang) 2014/02/03 22:52:48 with update => with the updated
Jennifer Messerly 2014/02/04 00:33:06 Done.
17 /// provide old value as the second argument, or other information. Regardless
Siggi Cherem (dart-lang) 2014/02/03 22:52:48 This was a bit confusing and I only understood wha
Jennifer Messerly 2014/02/04 00:33:06 attemped to reword this, also added more precise d
18 /// it should support functuons that accept a single argument.
Siggi Cherem (dart-lang) 2014/02/03 22:52:48 functiuons => functions
Jennifer Messerly 2014/02/04 00:33:06 Done.
19 open(callback);
20
21 /// Stops future notification and references to the callback passed to [open].
Siggi Cherem (dart-lang) 2014/02/03 22:52:48 notification -> notifications not sure what it mea
Jennifer Messerly 2014/02/04 00:33:06 reworded
22 void close();
23
24 /// Gets the current value of the bindings.
25 get value;
26
27 /// This can be implemented for two-way bindings. By default does nothing.
28 /// Note: setting the value of a [Bindable] must not call the [callback] with
29 /// the new value. Essentially the pending change is discarded.
Siggi Cherem (dart-lang) 2014/02/03 22:52:48 not sure what 'pending change' means here. Also -
Jennifer Messerly 2014/02/04 00:33:06 it's to avoid cycles in 2-way bindings, is my unde
30 set value(newValue) {}
31 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698