How to check if a variable is a solid-Mutable or -Store?
Is there a way how you can detect if a variable is a createMutable/Store-proxy? It is for the purpose of working with another library's proxies.
6 Replies
I think the only way is to add some property to it and see if it throws
would this be okay? it warns me that DEV can also be undefined
you can use the
$PROXY
symbol to check if it's a proxy at all
DEV is not available in prodyou just call it like an object?
state[$PROXY]
?
ok nice that seems to do the trick!oo nice, it's for interop with another library, so for my usecase rn it doesn't matter too much if it's a store or a mutable, but good to know