I have a Proxy
to mimic a virtual object. Getter of this proxy returns ready values.
I have discovered, that if the proxy is awaited, it leads to calling of the 'then' property of my proxy:
await myProxy
What should my proxy getter return in this situation? Is it a good idea to return the proxy itself, or a promise to itself?
Example is here:
What is confusing to me is that if I await
an object, I get the object, but if I await
a Proxy
, it needs to have a 'then' property trap which returns itself.