Skip to content

Commit

Permalink
use base for custom setters and add default setter as noop in favor o…
Browse files Browse the repository at this point in the history
…f custom one
  • Loading branch information
kbrsh committed Apr 15, 2017
1 parent 4343cf7 commit 669a3bb
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
5 changes: 3 additions & 2 deletions dist/moon.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@
}

return cache;
}
},
set: noop
});

// Add Setters
Expand Down Expand Up @@ -1708,7 +1709,7 @@

// Invoke custom setter
var setter = null;
if ((setter = observer.setters[key]) !== undefined) {
if ((setter = observer.setters[base]) !== undefined) {
setter.call(this, val);
}

Expand Down
2 changes: 1 addition & 1 deletion dist/moon.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/instance/methods.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Moon.prototype.set = function(key, val) {

// Invoke custom setter
let setter = null;
if((setter = observer.setters[key]) !== undefined) {
if((setter = observer.setters[base]) !== undefined) {
setter.call(this, val);
}

Expand Down
3 changes: 2 additions & 1 deletion src/observer/computed.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ const initComputed = function(instance, computed) {
}

return cache;
}
},
set: noop
});

// Add Setters
Expand Down

0 comments on commit 669a3bb

Please sign in to comment.