Replies: 1 comment 2 replies
-
But, it doesn't do for a map in a map?
At this point, I wouldn't include it in valtio/utils. But, I'm happy to have it in docs as a recipe. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Currently, if you are deserializing data from anywhere, you have to manually turn the deserialized data into
valtio
proxies. That's okay, but as it happened to me in real-world scenario, it didn't take long until it got unmanagable. The solution I came up with is after the process of deserialization, I introduced the "proxification" step, handled by aproxify
function that looks like the one below:It not only converts your data piece into a
proxy
(orproxySet
/proxyMap
), but also does it deeply/recursively. The above implementation requires some tweaks though, and I'd be glad to tune it up—even performance-wise—however I'd like to hear from you if that's something worth including atvaltio
's package itself.cc @dai-shi @fkhadra
Beta Was this translation helpful? Give feedback.
All reactions