Proxy(Blob) instead of actual Blob #739
-
Hi, i was wondering if i could use Valtio as a store for Blob objects. in one file i have this state in another i gather from < input /> user's media file, and procede as such: but when i try to access both, such as console.log , the url , as a string , "works" as it is console.logged correctly, also it is used to display the image correctly inside < img /> here attached screenshot of the console.log. I therefore assume Valtio cannot store heavy objects as such, am i wrong / missing something ? Or can the behaviour be achieved in other fashion ? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
In fact, Valtio proxies are designed for plain objects. |
Beta Was this translation helpful? Give feedback.
In fact, Valtio proxies are designed for plain objects.
In the past, we discussed about opt-in / opt-out approaches for non-plain objects. We decided for opt-out approach.
You should use
ref()
to put non-plain objects in Valtio proxies.