Permalink
Browse files

fix(watch): Added a setter to watch to fix #4

  • Loading branch information...
calebdwilliams committed Aug 3, 2018
1 parent d82a664 commit d4f28572cc65b30bd0c5140e5e9712d9a129d624
Showing with 6 additions and 1 deletion.
  1. +6 −1 src/templiteral.js
@@ -185,6 +185,11 @@ export const watch = (object, onChange) => {
return Reflect.get(target, property, receiver);
}
},
set(target, property, value) {
target[property] = value;
onChange(target, property, { value });
return true;
},
defineProperty(target, property, descriptor) {
const define = Reflect.defineProperty(target, property, descriptor);
onChange(target, property, descriptor);
@@ -219,4 +224,4 @@ export const debounce = (fn, wait, immediate) => {

callNow && Reflect.apply(fn, context, args);
};
};
};

0 comments on commit d4f2857

Please sign in to comment.