-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BUGFIX beta] Cleanup CP set, volatile and various related things.
Breakup set method into a top level branching method that has 4 paths, readonly check/throw, clobber set, volatile set or normal set. `volatile()` does not simply mean don’t cache, it means this value is inherently not observable and/or you need to manually notify/cache the value. ArrayProxy is a good example, length is observable but has to be manually notified for NativeArray mixin, so ArrayProxy just delegates to the underlying array but doesn’t setup DKs or any notification since it is notified already by the mutation methods. It is not an escape value for you not getting the correct DKs or it seems to solve some bug I can’t figure out. It is not the equivalent of the old sprout core behavior and hasn’t been for a while. If you have a dependency that does not fit into a DK, you can notifyPropertyChange() manually. If you don’t understand the above you should not be using `volatile` it has an extremely narrow use case. Conflicts: packages/ember-metal/lib/chains.js packages/ember-metal/lib/computed.js Cherry-picked from 4678ce9
- Loading branch information
1 parent
689318b
commit e25b57c
Showing
6 changed files
with
120 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
e25b57c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've used "volatile" after using a computed property with a new getter and setter and noticing that the "get" is not called after the "set" was called. Which means the value was always the same.
Is it now fixed and I can remove "volatile"?
e25b57c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should provide an running example of your problem, its tricky to be sure interpretations of your written problem are correct.