Ziltoid
How do I modify a member of an object in an array in a SolidJS Store using the SetStoreFunction?
Got an answer from @foolswisdom on the SO post, the issue was hinted at by @mdynnl but I didn't understand tracking/reactive scope well enough to understand. This makes it much more clear, and also why the native input works even though the tracking scope issue was still there. Many thanks to all!
12 replies
How do I modify a member of an object in an array in a SolidJS Store using the SetStoreFunction?
Update:
I tried switching to native UI elements instead of Kobalte and now it works. See the SO post for what I did.
However it doesn't explain the behavior or make sense to me, and I'd like to use Kobalte, so this is still an unresolved issue. I'll try asking in the Kobalte channel
12 replies
How do I modify a member of an object in an array in a SolidJS Store using the SetStoreFunction?
I don't fully understand what you're saying yet but I think that is the problem.
I tried the following:
And I am able to observe the store being updated correctly, the issue is that the text fields aren't being updated, as you mentioned.
Now I need to figure out how to make it so that the fields update when the store updates. My expectation was that it would automatically be handled when using a store. I'm not sure if I'm using it wrong or what the problem is
12 replies
How do I modify a member of an object in an array in a SolidJS Store using the SetStoreFunction?
I don't think so- I'm using Kobalte which uses onChange: https://kobalte.dev/docs/core/components/text-field#controlled-value , their example works on any input, not just focus change
12 replies
Derived Signals vs Memos
Thanks for the quick reply 🙂
I think I see, that derived signals are preferable in most cases due to the lack of overhead introduced by caching with memos. Memos are only used when the benefit of caching outweighs the extra overhead introduced.
It seems like this would usually come down to how many different things read the [ derived signal or memo ] (let's call it function), and/or how expensive the function is.
I'm not quite sure what the implications of lazy vs eager are. Does it have to do with for example what's on screen vs not? i.e. if our function is used only in something not on the screen, a lazy derived signal is not run. But if it was instead a memo it would run despite not impacting anything.
Is the above correct?
createMemo is a subset of derived signals.I was actually thinking of it the other way, that a memo is a superset of a derived signal. i.e. memos are a derived signal that also has caching behavior on top. Maybe we are both correct depending on the way we look at it and it's not important. But let me know if I'm misunderstanding something.
5 replies