How to get data from proxy object?
Hi
I've been working on a project that reads a proxy object.
For this I have created a class to handle the get/set data of the properties and an array to hold the names of the properties in each element.
This part works but i'm stuck at getting the data from the proxy. How do I do this? edit: As far as I can see there is no way to pass the object back as json. I could only see a method to get the properties but I couldn't get any method to actually set the values.
Edit 2. For those of you that are concerned about using non-standard coding: for some cases like this I create my own interface class which acts as a wrapper to get me round the issues. I'd like to say that I was very clear with the problem and I hope the solution is not too hard to understand for anyone else with this issue. It's not possible using get or set. You could use a getter/setter to get and set properties. However, you could use reflection to do this in PHP 5. See here for more information.
If you're using the old way of calling objects through the constructor, that means your object is not serializable and therefore you can't send it through proxies either.
What is the proxy object in JavaScript console log?
What is the meaning of the proxy object appearing in JavaScript console log?
Var myObject = ;. Var objectName = 'A'; //'A' is some string value, but it should be the id of this kind of DOM element which already exists. What is this for, and how to understand this log, please? In a similar case as follows. I don't think there will appear a weird object with undefined members inside (I also tried to log them, and none appears). I don't know why this proxy object comes.
There is no special meaning of proxy objects, they are just objects constructed from regular objects under-the-hood using Reflect.
Related Answers
What is a proxy object in Python?
I have been trying to wrap all my objects into a proxy-like object for almo...
What does Proxy mean in console log?
Proxy object is one of the useful feature to add in Vue 3. In this article,...
How to get value from proxy object?
I have been working on an assignment in our Data Structure and Algorithm class, and...