From NVRM's answer to this stackoverflow question
/* Simplest Object Observer */
Object.observe = (o, f) => new Proxy(o, { set: (a, b, c) => f(a, b, c) })
var obj = {
foo: 0,
bar: 1
};
// Assignment after creation, keep the variable name, extend.
obj = Object.observe(obj, function(target, prop, changes) {
console.log("Change detected!", prop, changes)
})
obj.baz = 2;
obj.foo = 'hello';
/// EXAMPLES