This repository was archived by the owner on Feb 22, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 248
Renaming the Scope.watch readOnly argument #739
Comments
vicb
added a commit
to vicb/angular.dart
that referenced
this issue
Mar 20, 2014
closes dart-archive#739 This changes is a BC break: - the "readOnly" parameter has been renamed to "canChangeModel", - the semantic is inversed Before: // Default to digest (readOnly = false by default) scope.watch(exp, fn); // Explicit flush scope.watch(exp, fn, readOnly: true); After // Default to digest (canChangeModel = true by default) scope.watch(exp, fn); // Explicit flush scope.watch(exp, fn, canChangeModel: false);
vicb
added a commit
to vicb/angular.dart
that referenced
this issue
Mar 31, 2014
closes dart-archive#739 This changes is a BC break: - the "readOnly" parameter has been renamed to "canChangeModel", - the semantic is inversed Before: // Default to digest (readOnly = false by default) scope.watch(exp, fn); // Explicit flush scope.watch(exp, fn, readOnly: true); After // Default to digest (canChangeModel = true by default) scope.watch(exp, fn); // Explicit flush scope.watch(exp, fn, canChangeModel: false); Conflicts: example/web/bouncing_balls.dart lib/core/scope.dart lib/directive/ng_class.dart lib/directive/ng_style.dart
vicb
added a commit
to vicb/angular.dart
that referenced
this issue
Mar 31, 2014
closes dart-archive#739 This changes is a BC break: - the "readOnly" parameter has been renamed to "canChangeModel", - the semantic is inversed Before: // Default to digest (readOnly = false by default) scope.watch(exp, fn); // Explicit flush scope.watch(exp, fn, readOnly: true); After: // Default to digest (canChangeModel = true by default) scope.watch(exp, fn); // Explicit flush scope.watch(exp, fn, canChangeModel: false);
vicb
added a commit
to vicb/angular.dart
that referenced
this issue
Mar 31, 2014
closes dart-archive#739 This changes is a BC break: - the "readOnly" parameter has been renamed to "canChangeModel", - the semantic is inversed Before: // Default to digest (readOnly = false by default) scope.watch(exp, fn); // Explicit flush scope.watch(exp, fn, readOnly: true); After: // Default to digest (canChangeModel = true by default) scope.watch(exp, fn); // Explicit flush scope.watch(exp, fn, canChangeModel: false);
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
When adding a watch, there is a
readOnly
argument. The effect of settingreadOnly
to true is that the watch expression will be evaluated in the flush phase rather than the digest phase.It should be used when the watch could not result in updating the model and lead to better performance as the expression it evaluated only once instead instead multiple time until the digest converges.
We have been discussing with @mhevery about renaming this argument.
Potential candidates:
flushPhase
canChangeModel
The former describes more the implementation, the latter has my preference.
Thoughts ? Any other proposal ?
The text was updated successfully, but these errors were encountered: