conartist6
conartist6
SSolidJS
Created by conartist6 on 7/11/2024 in #support
Objects passing through a store are copies, even after unwrapping... why?
No description
35 replies
SSolidJS
Created by conartist6 on 7/11/2024 in #support
Objects passing through a store are copies, even after unwrapping... why?
for now I just have
const { range, setRange } = useContext(SelectionContext);
const { range, setRange } = useContext(SelectionContext);
35 replies
SSolidJS
Created by conartist6 on 7/11/2024 in #support
Objects passing through a store are copies, even after unwrapping... why?
Yeah, that makes sense. In this case the change is literally just that the user clicked something, changing the selection. I originally had it as a signal and it worked fine.
35 replies
SSolidJS
Created by conartist6 on 7/11/2024 in #support
Objects passing through a store are copies, even after unwrapping... why?
I am certainly willing to try making signals
35 replies
SSolidJS
Created by conartist6 on 7/11/2024 in #support
Objects passing through a store are copies, even after unwrapping... why?
the piece of state is essentially { selectedRange: [start, end] }, where start and end are the immutable objects giving me trouble
35 replies
SSolidJS
Created by conartist6 on 7/11/2024 in #support
Objects passing through a store are copies, even after unwrapping... why?
In general the existence of WeakMap means that it is not necessarily safe to copy any object you don't know, as you may be discarding private information
35 replies
SSolidJS
Created by conartist6 on 7/11/2024 in #support
Objects passing through a store are copies, even after unwrapping... why?
Basically though the data structure I'm working with is a tree made up of nodes wired together with WeakMap linkages
35 replies
SSolidJS
Created by conartist6 on 7/11/2024 in #support
Objects passing through a store are copies, even after unwrapping... why?
if what was stored in the object could change, the cached information could become invalid later
35 replies
SSolidJS
Created by conartist6 on 7/11/2024 in #support
Objects passing through a store are copies, even after unwrapping... why?
The identities of those objects are used to cache some metadata about what is stored in them
35 replies
SSolidJS
Created by conartist6 on 7/11/2024 in #support
Objects passing through a store are copies, even after unwrapping... why?
35 replies
SSolidJS
Created by conartist6 on 7/11/2024 in #support
Objects passing through a store are copies, even after unwrapping... why?
OH. It normally doesn't copy the object, it only does that because these objects are frozen
35 replies
SSolidJS
Created by conartist6 on 7/11/2024 in #support
Objects passing through a store are copies, even after unwrapping... why?
but it'd just be a huge waste of work : /
35 replies
SSolidJS
Created by conartist6 on 7/11/2024 in #support
Objects passing through a store are copies, even after unwrapping... why?
I think the only really stupid way I could hack around this is to map the reference-stable messed up copied values back to the reference-stable original good values. An unwrap-unwrapper, if you will
35 replies
SSolidJS
Created by conartist6 on 7/11/2024 in #support
Objects passing through a store are copies, even after unwrapping... why?
Ugh, that still won't work though because it relies on the immutable values passing through the Solid layer for binding, which can't happen because a Solid store destroys them if it touches them
35 replies
SSolidJS
Created by conartist6 on 7/11/2024 in #support
Objects passing through a store are copies, even after unwrapping... why?
not unlike how things work when you use connect really
35 replies
SSolidJS
Created by conartist6 on 7/11/2024 in #support
Objects passing through a store are copies, even after unwrapping... why?
and then each view's store will be bound to part of the overall immutable redux state
35 replies
SSolidJS
Created by conartist6 on 7/11/2024 in #support
Objects passing through a store are copies, even after unwrapping... why?
I guess what I have to do is keep an solid store for every view
35 replies
SSolidJS
Created by conartist6 on 7/11/2024 in #support
Objects passing through a store are copies, even after unwrapping... why?
of course there is no way of knowing that an object is deeply immutable without going through it deeply and checking, which is a huge pain
35 replies
SSolidJS
Created by conartist6 on 7/11/2024 in #support
Objects passing through a store are copies, even after unwrapping... why?
It's pretty unfortunate that unwrap does what it does because the objects it copies are already deeply immutable, which is why I care about their identity staying stable
35 replies
SSolidJS
Created by conartist6 on 7/11/2024 in #support
Objects passing through a store are copies, even after unwrapping... why?
I guess I'm back at the point where I can't use the solid store but I could use redux and reconcile...?
35 replies