I understand that Proxy
can be used to alter object-level behaviors, such as bracket notation get and set. All the examples I can find show constructing an object and then wrapping it with a Proxy
call. Is there a way to define a class Foo
, using ES6 class constructor notation, such that the returned object from the constructor is already wrapped in Proxy
, rather than the caller of the constructor having to also call Proxy
separately?
Thanks in advance.