Skip to main content
edited tags
Link
dumbass
  • 27.3k
  • 4
  • 43
  • 77
Source Link
yawn
  • 526
  • 1
  • 7
  • 26

Transform a Javascript object into a proxy (and not its reference)

I can take a Javascript object o and create a new Proxy object from it:

let p = new Proxy(object, { ... })

But is there a way to mutate an existing object reference to track changes on the original object? In particular, is there a way I can track the addition of new keys on the object from exterior sources?