Skip to content

Commit

Permalink
Keep it real for notifyPath.
Browse files Browse the repository at this point in the history
  • Loading branch information
kaste committed Feb 25, 2016
1 parent 809352d commit 40a1f79
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/standard/notify-path.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,20 +70,17 @@
* Example:
*
* this.item.user.name = 'Bob';
* this.notifyPath('item.user.name', this.item.user.name);
* this.notifyPath('item.user.name');
*
* @param {string} path Path that should be notified.
* @param {*} value Value of the specified path.
* @param {boolean=} fromAbove When true, specifies that the change came
* from above this element and thus upward notification is not
* necessary.
* @return {boolean} Returns true if notification actually took place,
* based on a dirty check of whether the new value was already known.
*/
notifyPath: function(path, value, fromAbove) {
// Convert any array indices to keys before notifying path
var info = {};
this._get(path, this, info);
var v = this._get(path, this, info);
if (arguments.length === 1) {
value = v;
}
// Notify change to key-based path
if (info.path) {
this._notifyPath(info.path, value, fromAbove);
Expand Down

0 comments on commit 40a1f79

Please sign in to comment.