Edit in JSFiddle

function reactive (obj) {
  for (let key in obj) {
    let value = obj[key]

    obj.__defineGetter__(key, function reactiveGetter () {
      return value
    })

    obj.__defineSetter__(key, function reactiveGetter (newValue) {
      console.log('setting value from', value, 'to', newValue)
      value = newValue
    })
  }
}

const reactiveData = {
  foo: 1
}

reactive(reactiveData)

reactiveData.foo++
console.log(reactiveData.foo)
<h1>
Look into your Javascript console!
</h1>