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

Unified Diff: pkg/observe/lib/src/change_notifier.dart

Issue 178683003: [observe] use consistent comment style (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/observe/lib/src/bind_property.dart ('k') | pkg/observe/lib/src/change_record.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/observe/lib/src/change_notifier.dart
diff --git a/pkg/observe/lib/src/change_notifier.dart b/pkg/observe/lib/src/change_notifier.dart
index 54653e9e99115313cbb133b61130bfa845539d16..7febee562809dcce54d0840be77a964226a4600b 100644
--- a/pkg/observe/lib/src/change_notifier.dart
+++ b/pkg/observe/lib/src/change_notifier.dart
@@ -9,14 +9,12 @@ import 'dart:collection' show UnmodifiableListView;
import 'package:observe/observe.dart';
import 'package:observe/src/observable.dart' show notifyPropertyChangeHelper;
-/**
- * Mixin and base class for implementing an [Observable] object that performs
- * its own change notifications, and does not need to be considered by
- * [Observable.dirtyCheck].
- *
- * When a field, property, or indexable item is changed, a derived class should
- * call [notifyPropertyChange]. See that method for an example.
- */
+/// Mixin and base class for implementing an [Observable] object that performs
+/// its own change notifications, and does not need to be considered by
+/// [Observable.dirtyCheck].
+///
+/// When a field, property, or indexable item is changed, a derived class should
+/// call [notifyPropertyChange]. See that method for an example.
abstract class ChangeNotifier implements Observable {
StreamController _changes;
List<ChangeRecord> _records;
@@ -31,15 +29,11 @@ abstract class ChangeNotifier implements Observable {
// TODO(jmesserly): should these be public? They're useful lifecycle methods
// for subclasses. Ideally they'd be protected.
- /**
- * Override this method to be called when the [changes] are first observed.
- */
+ /// Override this method to be called when the [changes] are first observed.
void observed() {}
- /**
- * Override this method to be called when the [changes] are no longer being
- * observed.
- */
+ /// Override this method to be called when the [changes] are no longer being
+ /// observed.
void unobserved() {
// Free some memory
_changes = null;
@@ -55,27 +49,23 @@ abstract class ChangeNotifier implements Observable {
return false;
}
- /**
- * True if this object has any observers, and should call
- * [notifyPropertyChange] for changes.
- */
+ /// True if this object has any observers, and should call
+ /// [notifyPropertyChange] for changes.
bool get hasObservers => _changes != null && _changes.hasListener;
- /**
- * Notify that the field [name] of this object has been changed.
- *
- * The [oldValue] and [newValue] are also recorded. If the two values are
- * equal, no change will be recorded.
- *
- * For convenience this returns [newValue]. This makes it easy to use in a
- * setter:
- *
- * var _myField;
- * @reflectable get myField => _myField;
- * @reflectable set myField(value) {
- * _myField = notifyPropertyChange(#myField, _myField, value);
- * }
- */
+ /// Notify that the field [name] of this object has been changed.
+ ///
+ /// The [oldValue] and [newValue] are also recorded. If the two values are
+ /// equal, no change will be recorded.
+ ///
+ /// For convenience this returns [newValue]. This makes it easy to use in a
+ /// setter:
+ ///
+ /// var _myField;
+ /// @reflectable get myField => _myField;
+ /// @reflectable set myField(value) {
+ /// _myField = notifyPropertyChange(#myField, _myField, value);
+ /// }
notifyPropertyChange(Symbol field, Object oldValue, Object newValue)
=> notifyPropertyChangeHelper(this, field, oldValue, newValue);
« no previous file with comments | « pkg/observe/lib/src/bind_property.dart ('k') | pkg/observe/lib/src/change_record.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698