In my code, I am using a special Proxy
to imitate a virtual object. The getter of this proxy returns values that are already prepared.
After some exploration, I found out that when the proxy is awaited, it triggers the 'then' property of the proxy:
await myProxy
In light of this, what should the getter of my proxy return? Would it be wise to return the proxy itself or a promise to itself?
For reference, you can see an example here:
One thing that puzzles me is that when I await
an object, I receive the object itself, but when I await
a Proxy
, it requires a 'then' property trap that returns the proxy again.