-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
the set method is loosing the reference. #431
Comments
This is indeed the intended behavior, load an object via Can you explain why you need to apply the changes to your existing object instance and why replacing the object is not an option? |
I was just curious, since I was passing an object, I was expecting JSONEditor to update that same object so I don't have to call every time JSONEditor.get to refresh my object. Btw thank you for that awesome json editor. 🏅 |
Thanks, you're welcome. Having JSONEditor mutate the JSON object that you pass it via In general, the JavaScript community is moving away from shared objects which can are manipulated by different parts of an application at the same time, towards functional and immutable techniques. This leads to much easier to understand code, easier to understand flow of data through an application, and easier to test and debug code. I think that's great! The new JSONEditor v6 version that I'm working on will have a new function which gives you JSONPatch changes via |
True what you are saying makes total sense. It's more safe. Excited to try the v6! ;) |
👍 |
Hi,
Is there a way for JSONEditor.set method, to not loose the reference of my object ?
So basically when I change something in the editor, it should automatically reflect on my object, right now the only solution is to use JSONEditor.get and reset my object.
Thanks for the help!
The text was updated successfully, but these errors were encountered: