stereokai
stereokai
SSolidJS
Created by stereokai on 9/18/2024 in #support
Template doesn't react to property change in store of array of objects
@Alex Lohr that's right, I'm even using it somewhere else. Thanks!
36 replies
SSolidJS
Created by stereokai on 9/18/2024 in #support
Template doesn't react to property change in store of array of objects
Got it. Since at the moment the class has only 2 properties that warrant reactivity I'm opting for the direct getter/setter method. But I'll definitely keep this lesson in mind. Thanks!
36 replies
SSolidJS
Created by stereokai on 9/18/2024 in #support
Template doesn't react to property change in store of array of objects
@REEEEE Thank you very much, that's an interesting link. Just been experimenting with createMutable, what would be the correct way to locate the current user for updating - assuming there's no id or index? Now they are in fact not matching anymore, as @Alex Lohr expected.
produce((users) => {
const user = users.find((user) => user === currUser);
if (user) {
user.name = userName();
}
}),
produce((users) => {
const user = users.find((user) => user === currUser);
if (user) {
user.name = userName();
}
}),
36 replies
SSolidJS
Created by stereokai on 9/18/2024 in #support
Template doesn't react to property change in store of array of objects
I see. That's cool. However this class also has some more complex objects and arrays as props. Is it possible to explicitly exclude them from createMutable? Or is it all-inclusive
36 replies
SSolidJS
Created by stereokai on 9/18/2024 in #support
Template doesn't react to property change in store of array of objects
Thanks. That's creative. Possible to wrap a signal with a getter and setter right?
36 replies
SSolidJS
Created by stereokai on 9/18/2024 in #support
Template doesn't react to property change in store of array of objects
@REEEEE you mean each user, right? Yes, each user is a class. How could I get around this limitation?
36 replies
SSolidJS
Created by stereokai on 9/18/2024 in #support
Template doesn't react to property change in store of array of objects
No description
36 replies
SSolidJS
Created by stereokai on 9/18/2024 in #support
Template doesn't react to property change in store of array of objects
And as I explained, when inspecting the store, I do see the updated user name
36 replies
SSolidJS
Created by stereokai on 9/18/2024 in #support
Template doesn't react to property change in store of array of objects
@Alex Lohr Thanks, but the actual object is a bigger class. My code example is just a simplification of the pattern. However the essentials are identical 🙂 Below is a screen shot of a debugger on the code. As you can see, the 2 objects are matching in the find callback (you can see Return value: true on the right).
36 replies
SSolidJS
Created by stereokai on 9/18/2024 in #support
Template doesn't react to property change in store of array of objects
I appreciate your help but it's too terse for me to fully grasp your point. Is the fact that they are matching a problem?
36 replies
SSolidJS
Created by stereokai on 9/18/2024 in #support
Template doesn't react to property change in store of array of objects
But this function (user) => user === currUser, which is used in both methods, does match the object by reference.
36 replies
SSolidJS
Created by stereokai on 9/18/2024 in #support
Template doesn't react to property change in store of array of objects
What does ref-safe mean? Just so we speak the same language 🙂 Thanks
36 replies
SSolidJS
Created by stereokai on 9/18/2024 in #support
Template doesn't react to property change in store of array of objects
But I am not replacing any objects? I am sorry but I'm not sure I fully understand what you're trying to say. Using both store update methods, inspecting the store object reveals that the name key on the user object indeed updated as expected. However the template does not reflect the change.
36 replies
SSolidJS
Created by stereokai on 9/18/2024 in #support
Template doesn't react to property change in store of array of objects
However, I can see the change in the store object itself
36 replies
SSolidJS
Created by alexamy on 7/3/2024 in #support
Granular update of store array doesn't trigger effects depending on the whole array
Where can I see documentation for this access syntax?
26 replies