const watch = (value, callback)=>{ return new Proxy(value, { set: callback }) } const state = watch({ name: 'matt' }, (newValue) => { console.log(newValue); }) state.name = 'Matthew'